php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6825 Can't get ImageCreateFromJPEG to work with URLs
Submitted: 2000-09-21 00:49 UTC Modified: 2000-09-26 19:13 UTC
From: david dot king at commnav dot com Assigned: stas (profile)
Status: Closed Package: *Graphics related
PHP Version: 4.0.2 OS: Red Hat 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david dot king at commnav dot com
New email:
PHP Version: OS:

 

 [2000-09-21 00:49 UTC] david dot king at commnav dot 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-24 17:03 UTC] stas@php.net
Will fix as soon as CVS is up again
 [2000-09-26 19:13 UTC] stas@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC