Uploading Images in VirtueMart
When creating a product in VirtueMart, you’re able to upload images from your computer (versus choosing from the image library on the server / on your website). Sometimes, you may run into problems with the upload. You could get a blank screen or an error on the page.
Before you upload images, you should be aware of a few things since you may need to prepare your images before uploading them. Here are some tips.
Image Size – Physical
The physical image size (dimensions) should be less than 1024 pixels wide. What happens is, VirtueMart will need to resize the images and even though the file size on disk might be small (low resolution), some memory is used to resize the image and if the image’s dimensions are too large, then the upload could fail because the allowed amount of memory for that process might go over.
The best way to resize an image is with an image editing program like Photoshop. Other programs might work as well (“Preview” app on Apple Mac or “Microsoft Photo Editor” on Windows). When you save the image, make sure that you “Save As…” (or “Export…”) it as a new image or else you will be overwriting your original image. You may need the original image for print work or something.
Name it with the suffix “-sm” or put it in another folder. For example, rename an image called “Top.jpg” as “top-sm.jpg”. Did you notice that we changed it to lower case, too? The best way to name images for the web are lower case and alphanumeric (letter and numbers) with no spaces. Use a dash or underscore instead of a space. Never use characters like an apostrophe, exclamation point, or ampersand in a file name used on a website.
Image Size – On Disk
After you have done any necessary resizing and have saved it as a new image, look at the image size on disk. Is it large? People will have to download it. A 2 MB image is pretty big. There are some ways to work with images and get them down in size.