PHP 4.0 Bug #6825 Updated: Can't get ImageCreateFromJPEG to work with URLs
| From: | Bug Database | Date: | Sun, 24 Sep 2000 21:03:51 +0000 |
| Subject: | PHP 4.0 Bug #6825 Updated: Can't get ImageCreateFromJPEG to work with URLs | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33632@lists.php.net to get a copy of this message | ||
ID: 6825
Updated by: stas
Reported By: david.king@commnav.com
Status: Assigned
Bug Type: *Graphics related
Assigned To: stas
Comments:
Will fix as soon as CVS is up again
Previous Comments:
---------------------------------------------------------------------------
[2000-09-21 00:49:25] david.king@commnav.com
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
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6825