Page 2 of 2

Posted: Tue Mar 21, 2006 3:24 pm
by spacebass5000
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

Posted: Tue Mar 21, 2006 5:48 pm
by spacebass5000
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.

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);
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++ :D

Posted: Tue Mar 21, 2006 5:50 pm
by feyd
glad to help.