Re: Bug #12200 Updated: getimagesize() JPG Bug

From: Date: Mon, 23 Jul 2001 15:36:33 +0000
Subject: Re: Bug #12200 Updated: getimagesize() JPG Bug
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-60722@lists.php.net to get a copy of this message
function randFileName() { mt_srand ((double) microtime() * 1000000); $randval = mt_rand(); return $randval; } function fileExists($file) { error_reporting(5); $fp = fopen($file, "r"); if ($fp) { fclose($fp); return 1; } return 0; } function getPictureInfo($url) { $info = ""; $image = ""; $tmpFile = $this->randFileName(); //print($url); if ($this->fileExists($url) == 1) { $fp = fopen($url, "r"); $image = fread($fp, 16384); this path exists fclose($fp); | while ($this->fileExists($this->writePath . $tmpFile) == 1) { $tmpFile = $this->randFileName(); } $fp = fopen($this->writePath . $tmpFile, "w"); fwrite($fp, $image); fclose($fp); //unset($image); $info = GetImageSize($this->writePath . $tmpFile); unlink($this->writePath . $tmpFile); } if ($info == "") { $info[] = -1; $info[] = -1; } return $info; } ----- Original Message ----- From: "Bug Database" <php-dev@lists.php.net> To: <ales.kunst@uni-mb.si> Sent: Saturday, July 21, 2001 5:57 PM Subject: Bug #12200 Updated: getimagesize() JPG Bug > ID: 12200 > Updated by: andy > Reported By: ales.kunst@uni-mb.si > Status: Feedback > Old Bug Type: GD related > Bug Type: GetImageSize related > Operating System: Win 2000 > PHP Version: 4.0.6 > New Comment: > > reclassified > > Previous Comments: > ------------------------------------------------------------------------ > > [2001-07-21 20:55:42] andy@php.net > > Please include a short sample script so I can test this. > > ------------------------------------------------------------------------ > > [2001-07-17 06:58:05] ales.kunst@uni-mb.si > > GD library doesn't work properly when you call getimagesize() for jpeg image!It doesn't return proper width and height of image (usually returns -1 and -1) > > ------------------------------------------------------------------------ > > > > ATTENTION! Do NOT reply to this email! > To reply, use the web interface found at http://bugs.php.net/?id=12200&edit=2 > >

« previous php.dev (#60722) next »