Image upload issue

ttyR2

No avatar

2005-09-21 07:51

I've searched through the forum and have seen a number of issues with uploading product images. In my case, I have to resize images down to 20KB or less, and even then, sometimes the images don't upload, giving the dreaded:

Fatal error: Call to undefined function: imagecreatefromjpeg() in /var/www/html/tgr/quickcart/libraries/FotoJobs.php on line 264

Has anyone found a foolproof fix for this? I have the folder called products, it's chmod'ed to 777, and the files are actually uploading to the folder, but they aren't linked because of the error.

Out of two files I've uploaded, one worked perfectly, the other generated the error and didn't work though the file did upload.

I'm running Fedora Core 3, apache2.0.53-3.3, php4.3.11, gd2.0.28-1.30.1

ttyR2

No avatar

2005-09-21 07:51

Sorry, the images always upload, but don't necessarily process in quick.cart and aren't usable.

wizzud

No avatar

2005-09-21 10:18

Quick test for level of GD support:
Create a small PHP file, eg. gdsupportinfo.php, and put these lines in it ...

<?php
if(function_exists('gd_info')) {var_dump(gd_info());} else {echo "No GD support";}
?>

Upload it and run it from your browser. If GD is enabled, it has simple boolean flags telling you what picture formats are supported (GIF, JPG, PNG, WBMP, etc).

ttyR2

No avatar

2005-09-21 16:14

"No GD support" is the reply. In searching Google.com, I haven't seen a howto specifically for enabling GD2 with php 4.3.11. Everything I have found relates to Windows implementation of GD/PHP.

ttyR2

No avatar

2005-09-21 16:37

Okay...it turns out I didn't have the php-gd module installed. PHP and GD2 were installed seperately, but didn't have the necessary php-gd module. Using Fedora Core 3 (other distros will be similar) I did a [yum install php-gd] and yum did it's thing, downloading the correct version. Then a [service httpd restart] and the gdsupportinfo.php returned:

array(11) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }

Image uploads look like they're working now. It might be helpful in the about.txt file to specifically list php-gd as a requirement as it may well not install by default under linux.

adam

Avatar: adam

2005-09-21 17:58

well ... I used the same php script on my sever and it returned

array(9) { ["GD Version"]=> string(13) "2.0 or higher" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(false) ["GIF Create Support"]=> bool(false) ["JPG Support"]=> bool(false) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(false) }

does that imply that I new a newer version of GD library ....

adam

ttyR2

No avatar

2005-09-21 18:31

What distro are you using? Should be a way to query for the actual version of the GD package you have installed. I'm not a programmer or much of a linux person for that matter, so can't say why running the script in your case returns "2.0 or higher" instead of the actual version on mine. Mine was installed bundled with php4 when I installed the OS initially.

adam

Avatar: adam

2005-09-22 10:41

well I am not sure, all I know is that I have PHP Version 4.3.1 and GD support enabled for
GD Support enabled
GD Version 2.0 or higher
PNG Support enabled
WBMP Support enabled

how do you get the bundled version ?

adam

ttyR2

No avatar

2005-09-24 06:01

bundled meant it came with php in the default Fedora install, as opposed to installing php after the fact.

Back to top
about us | contact