PHP 4.0 Bug #6825: Can't get ImageCreateFromJPEG to work with URLs

From: Date: Thu, 21 Sep 2000 04:49:25 +0000
Subject: PHP 4.0 Bug #6825: Can't get ImageCreateFromJPEG to work with URLs
Groups: php.dev 
Request: Send a blank email to php-dev+get-33519@lists.php.net to get a copy of this message
From: david.king@commnav.com Operating system: Red Hat 6.2 PHP version: 4.0.2 PHP Bug Type: *Graphics related Bug description: Can't get ImageCreateFromJPEG to work with URLs ImageCreateFromJPEG fails when I try to create a JPEG image from a URL. The function works fine when I try it with the same exact image stored locally. I can't find any mention of this in the bugs DB or on the mailing lists. Configure Line: './configure' '--with-mysql' '--with-ldap=/usr/local/openldap' '--with-ftp' '--with-imap' '--enable-wddx' '--with-gettext' '--with-readline' '--with-mm' '--enable-sysvsem' '--enable-sysvshm' '--with-oci8=/usr/local/oracle/product/8.0.5' '--with-apxs=/usr/local/apache/bin/apxs' '--with-config-file-path=/usr/local/apache/conf' '--enable-track-vars' '--with-zlib' '--with-gd' '--with-jpeg-dir=/usr/include' '--with-ttf' Here are the values for GD from phpinfo(): GD Support enabled GD Version 1.6.2 or higher PNG Support enabled JPG Support enabled WBMP Support enabled Hopefully, I'm just doing something wrong: **** BEGIN CODE **** <?php $URLImage = "http://www.apple.com/macosx/images/top_osx_beta_folder.jpg"; $localImage = "top_osx_beta_folder.jpg"; if (!$srcImg = ImageCreateFromJPEG($URLImage)) { echo "Couldn't create image identifier from file \"$URLImage\".<BR>\n"; echo "image: \"$srcImg\"<BR>\n"; } else { echo "Successful! Created image identifier from file \"$URLImage\"!<BR>\n"; echo "image: \"$srcImg\"<BR>\n"; } echo "<BR>\n"; if (!$srcImg = ImageCreateFromJPEG($localImage)) { echo "Couldn't create image identifier from file \"$localImage\".<BR>\n"; echo "image: \"$srcImg\"<BR>\n"; } else { echo "Successful! Created image identifier from file \"$localImage\"!<BR>\n"; echo "image: \"$srcImg\"<BR>\n"; } ?> **** END CODE **** This is the output the code gives me: **** BEGIN OUTPUT **** Couldn't create image identifier from file "http://www.apple.com/macosx/images/top_osx_beta_folder.jpg". image: "" Successful! Created image identifier from file "top_osx_beta_folder.jpg"! image: "Resource id #1" **** END OUTPUT **** Try it for yourself. Let me know what you find out. This also happens for the ImageCreateFromPNG function. Thanks for your time, -David King

« previous php.dev (#33519) next »