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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 21, 2001 5:57 PM
Subject: Bug #12200 Updated: getimagesize() JPG Bug


> ID: 12200
> Updated by: andy
> Reported By: [EMAIL PROTECTED]
> 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] [EMAIL PROTECTED]
>
> Please include a short sample script so I can test this.
>
> ------------------------------------------------------------------------
>
> [2001-07-17 06:58:05] [EMAIL PROTECTED]
>
> 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
>
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to