ok, i was looking at that and scratching my chin
i did not write the code so i took it at face value
i shall go try this!
edit: man, you alright... i just noticed you linked me to the php.net docs. i already looked at them, but the fact that you did this rocks
Problem with imagecreatefromgif()
Moderator: General Moderators
-
spacebass5000
- Forum Newbie
- Posts: 11
- Joined: Tue Mar 21, 2006 7:31 am
I figured it out. The 3pd application I was using makes painstaking efforts to check the input files yet regardless if they are gif, jpg, or png ends up writing them as jpg's.
awesome... good stuff, yay even
Thank you so much for your efforts. You totally helped me come to the realization of why this is broke.
karma++
Code: Select all
switch($imginfo[2]) {
case 'JPG':
$src_img = imagecreatefromjpeg($this->tmpFile);
break;
case 'PNG':
$src_img = imagecreatefrompng($this->tmpFile);
break;
case 'GIF':
$src_img = imagecreatefromgif($this->tmpFile);
break;
}
if (!$src_img){
$ERROR = $lang_errors['invalid_image'];
return false;
}
$dst_img = imagecreatetruecolor($destWidth, $destHeight);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
imagejpeg($dst_img, $this->directory.$this->imageName, $this->quality);Thank you so much for your efforts. You totally helped me come to the realization of why this is broke.
karma++
Last edited by spacebass5000 on Tue Mar 21, 2006 5:56 pm, edited 1 time in total.