ImageTransform messing up pictures
| From: | Trevan | Date: | Sun, 28 Nov 2004 13:49:02 +0000 |
| Subject: | ImageTransform messing up pictures | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15878@lists.php.net to get a copy of this message | ||
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