|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-11-09 15:01 UTC] vhaban at atlas dot cz
Description: ------------ I am not able to open jpeg files using imagecreatefromjpeg function and still get this: Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'x.jpg' is not a valid JPEG file in ... But it seems that it is not the problem of current PHP version, because it behaves the same with 5.2.9. I have examined both internal and external GD library still with the same result. I have tried gd.jpeg_ignore_warning and also the bug with invalid return type is already solved in 5.3.1RC3. It seems to be rather some compilation error specific to 64 bit Fedora. But no errors are reported during compilation and everything seems to be fine, imagecreatefrompng() is doing perfectly, for example, and the jpeg images are not corrupted. Thank you for any help. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
I am running also PHP 5.3.0 on an old Fedora Core 6 x86_64 machine with an AMD64 processor and it is working well even with the return type bug. But the machine with Fedora 11 is a Core 2 Duo notebook. Firstly, I compile jpeg-7: ./configure --prefix=/usr/share/jpeg-7 make make install Secondly, I compile PHP with internal GD: ./configure --with-apxs2=/etc/httpd/bin/apxs --with-libdir=lib64 --with-gd --with-jpeg-dir=/usr/share/jpeg-7/lib --with-png-dir --with-xsl make make install phpinfo() tells about the gd this: gd GD Support enabled GD Version bundled (2.0.34 compatible) GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version unknown PNG Support enabled libPNG Version 1.2.37 WBMP Support enabled XBM Support enabled Directive Local Value Master Value gd.jpeg_ignore_warning 1 0 The code source is: <?php ini_set("memory_limit","384M"); ini_set("gd.jpeg_ignore_warning",1); $img = imagecreatefromjpeg("img/gdtest.jpg"); phpinfo(); ?> The image is an empty jpeg file created with GIMP. GIMP Image properties tells: 640 ? 400 pixels, RGB color, JPEG image, etc. What I get when I run the script is: Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /.../phpinfo.php on line 4 Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'img/gdtest.jpg' is not a valid JPEG file in /.../phpinfo.php on line 4 Where ... is the full path to the script. I can also send the jpeg image, but I think that the problem is somewhere else. Thank you for any further help.I tried to recompile PHP now and got this error when running configure with the same parameters as above: configure: error: GD build test failed. Please check the config.log for details. And the config.log contains this at the end: configure:35769: checking for jpeg_read_header in -ljpeg configure:36070: checking for png_write_image in -lpng configure:43319: gcc -o conftest -g -O2 -fvisibility=hidden conftest.c -lpng -lz -ljpeg -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm 1>&5 configure: failed program was: #line 43308 "configure" #include "confdefs.h" char foobar () {} char foobar(); int main() { foobar(); return 0; }