Author Topic: SOLVED: Problem Uploading Product Images (blank screen)  (Read 3718 times)


  • Beginner
  • *
  • Posts: 27
SOLVED: Problem Uploading Product Images (blank screen)
« on: December 23, 2011, 19:49:01 pm »
I've set up a new site with VirtueMart 2.  I've added the first product and everything works.  When I try to add a product image, I run into problems:

It's worth mentioning that I'm getting the following warnings at the top of the image page:

Notice: Use of undefined constant IMG_GIF - assumed 'IMG_GIF' in /var/www/html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 352
Notice: Use of undefined constant IMG_JPG - assumed 'IMG_JPG' in /var/www/html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 353
Notice: Use of undefined constant IMG_PNG - assumed 'IMG_PNG' in /var/www/html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 354
Notice: Use of undefined constant IMG_WBMP - assumed 'IMG_WBMP' in /var/www/html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 355

I have PHP error messages turned on (development site).  I know PHP quite well, and this shouldn't be a problem, but I suspect it may be related to the message I'm receiving at the bottom of the page:

The server does NOT support mime type recognition, using table
Supported filetypes for thumbnail creation

Which makes no sense, as all the image types do infact have mime types described in /etc/mime.types

At any matter, when I upload an image (a relatively small one: 35kb), I get a blank screen.  Apache and PHP aren't reporting any errors (save for the warnings above), I'm just getting a blank screen.  In fact, my whole site has turned into a blank screen, and if I try to open the product in the back end I get the same blank screen.  It's very strange.

I've ensured file permissions are set appropriately, the user 'apache' owns the folder and the permissions are set to 775.  I can even see that the image was properly uploaded.  Still, blank screen.

If I delete the product, everything goes back to normal.  However, this has put my development at a screeching halt.  I can't really build much of a site without any product images.  Can anyone help?  Perhaps I'm missing something?

(BTW: The problem appears to be independant of any browser).


  • Beginner
  • *
  • Posts: 27
Re: Problems Uploading Product Images
« Reply #1 on: December 24, 2011, 00:18:28 am »
I was able to figure this out.  I needed to install the PHP GD libraries.

Rather, I needed to upgrade the GD libraries.  I am running Centos, which came with PHP 5.1 by default.  I had installed GD on top of that, but then I later needed to upgrade to PHP 5.2, because Joomla required it.  I had upgraded most of the other packages, but somehow I neglected to upgrade GD.  Without it, VirtueMart obviously could not resize images for thumbnails.

I hope this helps anyone who runs into the same problem in the future.  Make sure you have the GD libraries installed, installed correctly, and have the right version.

Perhaps checking for the presence of GD libraries and providing a simple error message might help avoid some lengthy troubleshooting for users?