Bug #11020 Updated: GD not working on digitalcamera jpg's

From: Date: Tue, 22 May 2001 16:40:11 +0000
Subject: Bug #11020 Updated: GD not working on digitalcamera jpg's
Groups: php.dev 
Request: Send a blank email to php-dev+get-56297@lists.php.net to get a copy of this message
ID: 11020 Updated by: sniper Reported By: dat8hywb@stud.hitos.no Old-Status: Open Status: Closed Bug Type: GD related Operating system: PHP Version: 4.0.5 Assigned To: Comments: The getimagesize() is fixed in CVS. --Jani Previous Comments: --------------------------------------------------------------------------- [2001-05-22 12:04:28] dat8hywb@stud.hitos.no Look at the bugs for GetImageSize. I guess it's the same JPG problem with GD functions. This function works perfect with most jpg's but when uploading pictures from digital cameras it does nothing. <pre> function resize($bildet, $forholdstall) { $size = GetImageSize("$bildet"); $width = $size[0]; $height = $size[1]; echo "Skalerer..."; //regner ut forholdstall if ($width > $height) # resize ny bildestørrelse { $utregnettall = ($width / $forholdstall); $width = $forholdstall; $height = (int)($height / $utregnettall); } else { $utregnettall = ($height / $forholdstall); $height = $forholdstall; $width = (int)($width / $utregnettall); } if (strpos("$bildet", ".jpg") || strpos("$bildet", ".jpeg")) { $status = true; $img_in = ImageCreateFromJPEG("$bildet"); // den resiza fila skal være så mye mindre: $img_out = ImageCreate($width, $height); ImageCopyResized($img_out, $img_in,0,0,0,0, $width, $height, $size[0], $size[1]); ImageJPEG($img_out, "$bildet"); ImageDestroy($img_in); ImageDestroy($img_out); }#if else { $status = false; } $retur = array( "error" => $status, "height" => $height, "width" => $width ); return $retur; }# function resize </pre> --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11020&edit=2

« previous php.dev (#56297) next »