Good day, I'm having a problem working with an image that I've made with imagecreatefromjpeg. Here's the code:
$in_file = "IMG_0050.jpg"; echo "Testing for image ".$in_file."<BR />\n"; $image = imagecreatefromjpeg($in_file) || die("Failed to create image from file. <BR>\n"); echo "Resource ID: ".$image."<BR>\n"; echo "Image width: ".imagesx($image)."<BR>\n"; It reads in the file OK and prints out "1" as the Resource ID, as expected. However, imagesx fails with: imagesx(): supplied argument is not a valid Image resource in <the_program_location> on line 9 The resource ID was returned from imagecreatefromjpeg, so, I have no idea why it's "not valid". The image in question displays fine in Mozilla, etc, if that matters at all- and it's also a fairly large image, if that matters at all too. Other PHP functions that work with the image resource fail in the same way. This is on 4.3.3 / FreeBSD 5.1, built from the ports collection . I have also tried this on Red Hat 9, with a similar failure. Here's my phpinfo()'s configure: './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-zlib-dir=/usr' '--disable-all' '--with-regex=php' '--disable-cli' '--with-apxs2=/usr/local/sbin/apxs' '--with-bz2=/usr' '--enable-calendar' '--enable-ctype' '--with-curl=/usr/local' '--enable-dba' '--with-dom=/usr/local' '--with-dom-xslt=/usr/local' '--with-dom-exslt=/usr/local' '--enable-exif' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-xpm-dir=/usr/local' '--with-gdbm=/usr/local' '--with-gettext=/usr/local' '--with-iconv=/usr/local' '--with-imap=/usr/local' '--with-imap-ssl=/usr/local' '--with-inifile' '--enable-mbstring' '--enable-mbregex' '--with-mcal=/usr/local' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-mime-magic=/usr/share/misc/magic.mime' '--with-mysql=/usr/local' '--with-ncurses=/usr' '--with-ldap=/usr/local' '--with-openssl=/usr' '--enable-overload' '--with-pcre-regex=yes' '--enable-posix' '--with-pspell=/usr/local' '--with-readline' '--enable-session' '--enable-sockets' '--enable-tokenizer' '--enable-xml' '--with-expat-dir=/usr/local' '--with-xmlrpc' '--enable-xslt' '--with-xslt-sablot=/usr/local' '--with-zip=/usr/local' '--with-zlib=yes' '--prefix=/usr/local' 'i386-portbld-freebsd5.1' I have a feeling that I am missing something simple, but I don't know what it could be. I didn't find anything in the mailing list archives, and Googling for the error message just shows pages and pages of actual broken web pages. Thanks in advance for any help, ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php