Post by mike_jandreau » Sat Jul 31, 2010 4:30 am

When I insert an image into product.tpl via echo $thumb; it looks like the resized cached version has whitespace on both sides. Is that normal?

Image

That's a resized test image I'm using, and there's clearly about half an inch of white space on both sides. That's not in the fullsized image I uploaded.

Any help here?

New member

Posts

Joined
Mon Jul 26, 2010 1:38 am

Post by Karen » Sun Aug 01, 2010 5:46 pm

Unfortunately, when the program generates the thumbnail and main images, it adds white space padding to make the images match the size you dictate.

The only way to change this is to manually upload your own images to the cache folder after they've been created, overwriting them.

Or you can do as I did, and hire somebody to rewrite the program so that it reads from your original file. It's an easy fix and should be cheap to do.

Using OC version 1.4.8b
http://catandcaboodle.com/


User avatar
Active Member

Posts

Joined
Thu Jun 10, 2010 2:51 pm
Location - WA State, USA

Post by mike_jandreau » Tue Aug 03, 2010 4:40 am

Thanks for the reply Karen, but that's not what's happening at all here.

I have my "thumb" size set to 800x600, and I uploaded a 1027x768 image that resulted in the screenshot I attached previously.

It's not only downsizing the image upon upload, but adding the whitespace to compensate for the downsize, which it what I want to avoid having happen.

Hoping someone else can chime in here.

New member

Posts

Joined
Mon Jul 26, 2010 1:38 am

Post by JAY6390 » Tue Aug 03, 2010 8:10 am

The program will resize to the image dimensions you specify as Karen has said. It resizes keeping both width and height in proportion whilst making sure that both are below or equal to the two values you give (800 x 600 in your case). The rest is then filled with a white background to maintain the images are always the full 800 x 600
You should actually have an 800x600 image after a resize (I'm guessing it was 1024 not 1027)
If you don't can you delete the cache image and reload the page it is on and see if it's just a case of an old cached image

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Wed Aug 04, 2010 3:08 am

I've partially fixed this here:
http://forum.opencart.com/viewtopic.php ... 966#p83316

That will make the image background transparent if it supports transparency.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 13 guests