News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

SOLVED: Problem Uploading Product Images (blank screen)

Started by jaminv, December 23, 2011, 19:49:01 PM

Previous topic - Next topic

jaminv

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).

jaminv

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?

Ed Kiefer

#2
I'm running into this problem also. I just upgraded from PHP 7.2 to 7.3 and now I'm receiving this error. I can still add photos to the product, but it doesn't generate a thumbnail.
QuoteWarning: Use of undefined constant IMG_GIF - assumed 'IMG_GIF' (this will throw an Error in a future version of PHP) in /home/luxefi5/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 437

Warning: Use of undefined constant IMG_JPG - assumed 'IMG_JPG' (this will throw an Error in a future version of PHP) in /home/luxefi5/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 438

Warning: Use of undefined constant IMG_PNG - assumed 'IMG_PNG' (this will throw an Error in a future version of PHP) in /home/luxefi5/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 439

Warning: Use of undefined constant IMG_WBMP - assumed 'IMG_WBMP' (this will throw an Error in a future version of PHP) in /home/luxefi5/public_html/administrator/components/com_virtuemart/helpers/mediahandler.php on line 440

This is from the Joomla debug console.
{
    "__default": {
        "session": {
            "counter": 82,
            "timer": {
                "start": 1617457112,
                "last": 1617460315,
                "now": 1617460351
            },
            "client": {
                "forwarded": "98.253.92.218"
            },
            "token": "TJDry8W25goR0TSbg0XODOVyR4u4CIUF"
        },
        "registry": {
            "com_installer": {
                "message": "",
                "extension_message": ""
            },
            "com_virtuemart": {
                "product": {
                    "filter_order_Dir": "DESC",
                    "filter_order": "created_on",
                    "virtuemart_category_id": [
                        "8"
                    ],
                    "virtuemart_manufacturer_id": "0",
                    "filter_product": "",
                    "search_type": "",
                    "search_order": "bf",
                    "search_date": "13:39 3.4.2021",
                    "published": "-1",
                    "filter": {
                        "virtuemart_category_id": [
                            8
                        ],
                        "virtuemart_manufacturer_id": 0
                    },
                    "limit": "200",
                    "limitstart": 0
                },
                "virtuemart_custom_id": [
                    ""
                ],
                "edit": {
                    "filter_order_Dir": "DESC"
                },
                "config": {
                    "filter_order_Dir": "DESC"
                },
                "inventory": {
                    "filter_order_Dir": "DESC",
                    "filter_order": "product_s_desc",
                    "filter_product": "",
                    "search_type": "",
                    "limit": "200",
                    "limitstart": 0
                }
            },
            "com_users": {
                "edit": {
                    "user": {
                        "data": null,
                        "id": []
                    }
                }
            },
            "com_config": {
                "config": {
                    "global": {
                        "data": null
                    }
                }
            },
            "com_cache": {
                "cache": {
                    "filter": {
                        "search": ""
                    },
                    "client_id": 0,
                    "list": {
                        "fullordering": "group ASC",
                        "limit": "50"
                    },
                    "limitstart": 0
                }
            }
        },
        "user": {
            "id": "190",
            "name": "Edward Kiefer",
            "username": "edkiefer",
            "email": "sales@thervfactory.com",
            "password": "$2y$10$7gMl1SUv4cskQJ1kDv.zvuxdKnzuHO.S5jm3fWGuNCy22jXvY8LBO",
            "password_clear": "",
            "block": "0",
            "sendEmail": "1",
            "registerDate": "2017-03-02 21:28:56",
            "lastvisitDate": "2021-04-03 13:38:34",
            "activation": "0",
            "params": "{\"admin_style\":\"\",\"admin_language\":\"\",\"language\":\"en-GB\",\"editor\":\"jce\",\"helpsite\":\"\",\"timezone\":\"\"}",
            "groups": {
                "8": "8"
            },
            "guest": 0,
            "lastResetTime": "0000-00-00 00:00:00",
            "resetCount": "0",
            "requireReset": "0",
            "otpKey": "",
            "otep": ""
        },
        "application": {
            "queue": []
        }
    }
}