Code Comments
Programming Forum and web based access to our favorite programming groups.I am trying to use ImageTransform to create thumbnails for a gallery
that I am building. I am using the GD driver (PHP has gd installed with
it). But when I resize the image, the resulting image's color is
destroyed. It seems to turn it into black and white. I have followed
the examples that was included with the GD driver, but can't seem to
figure out what I am doing wrong. Here is my code. ($art is a
dataobject that stores the filename in a mysql table). Is there a
setting that I need to set? Or should I use a different driver? (this
occurs on my test and production server). The filetypes are jpg.
$thumbnail = Image_Transform::factory('GD');
$thumbnail->load(BASEDIR.$art->picture);
$thumbnail->keepSettingsOnSave(true);
$thumbnail->scaleMaxlength('150');
$path = pathinfo($art->picture);
$thumbnail_file = '/images/gallery/thumbnails/'.$path['basename'];
$thumbnail->save(BASEDIR.$thumbnail_file,'',200);
$art->thumbnail = $thumbnail_file;
Trevan
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.