VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: EvanGR on January 21, 2019, 13:00:28 PM

Title: Problem with product thumbnail generation?
Post by: EvanGR on January 21, 2019, 13:00:28 PM
Hello,

Did any of the recent VM versions suffer from thumbnail generation issues?

Our production site is currently on VM 3.2.15. Product thumbnails are the same size as the original image! (yes, they are located in the /resized/ folder). The thumbnail filenames do not contain the size (.e.g. _280x280.jpg) in the filename. Something seems to be broken with VM.

The older products and thumbnails, generated by VM 2.x, are fine.

The new products, that we put after the VM 3.2.15 upgrade (from VM 2.x) are not.

In a test site, we updated to VM 3.4.2. Same problem with previous products. No problem when adding new products.

The option "Enable Dynamic Thumbnail Resizing" is activated everywhere.


Thanks
Title: Re: Problem with product thumbnail generation?
Post by: jenkinhill on January 21, 2019, 15:23:00 PM
I am currently testing VM3.4.3.10011 and thumbs here are created normally and with the size appended to the filename.
Title: Re: Problem with product thumbnail generation?
Post by: EvanGR on January 22, 2019, 08:59:51 AM
Thanks. It also seems to work fine on VM 3.4.2 (on our test site), when adding new products.

The products that were created on VM 3.2.14 (production site), use thumbnails with the same size as the original image! (i.e. the /resized/ images are NOT resized at all)

It's probably a bug with VM 3.2.14. Need confirmation.

We then need a way to regenerate the thumbnails for those products, and produce properly resized thumbnails.
What is the recommended way to do that?

a) Use the displayMediaThumb function in my template, to enforce (and test) thumbnail creation at specific sizes
b) Use the 'Reset Thumbs' function in VM. Though I do not trust this option... I ended up with missing images for me, when I tried it once, in the past.

Thanks

Title: Re: Problem with product thumbnail generation?
Post by: EvanGR on January 22, 2019, 10:13:19 AM
Update:

The following:
$thumbFile = $product->images[$i]->displayMediaThumb("",true,"rel='vm-additional-images'", true, true, false, 40, 40);

does NOT create a new thumbnail image with a size of 40x40 (or approximate) in the 'resized' folder.

Can you spot a problem?

The above function runs in a loop, where $i counts each of the available product images.

Any help appreciated, thanks.

VM 3.4.2.
Title: Re: Problem with product thumbnail generation?
Post by: jjk on January 22, 2019, 11:24:38 AM
Quote from: EvanGR on January 21, 2019, 13:00:28 PM
The older products and thumbnails, generated by VM 2.x, are fine.

Sounds to me like an image path (location) issue. Some time ago (I don't remember in which version) the 'stories' folder was eliminated from the image path.
Title: Re: Problem with product thumbnail generation?
Post by: PRO on January 23, 2019, 21:17:01 PM
Quote from: EvanGR on January 22, 2019, 08:59:51 AM

We then need a way to regenerate the thumbnails for those products, and produce properly resized thumbnails.
What is the recommended way to do that?

empty the thumbnail folder.

Then they are created the first time a page loads with that specific thumbnail size set.

"Dynamic Thumbs" turned on
Title: Re: Problem with product thumbnail generation?
Post by: EvanGR on January 24, 2019, 09:08:13 AM
Thanks for the replies. After much research, I came to the conclusion that VM 3.2.15 (our production site) is to blame.

The thumbnails it creates, are not resized, they are the same size as the original image. It's a bug of some sort.

I have to 'Reset Thumbs' every time I create a new product, for the thumbnails to generate properly.

It seems to work fine on a test site with a newer VM version (VM 3.4.2 or similar)

Thanks for your time and patience.