News:

Looking for documentation? Take a look on our wiki

Main Menu

Thumbnail image based on height

Started by hk, April 18, 2013, 16:19:46 PM

Previous topic - Next topic

hk

Hi,

I have below settings in Virtuemart Configuration:
Enable Dynamic Thumbnail Resizing? : Yes
Thumbnail Image Width : 175
Thumbnail Image Height : 250

Whenever I upload an image for a product, the thumnail is created and stored in specified folder.

Question:
My image size is 800 x 600. After uploading it, the thumbail image is created of size 175 x 131. The thumbnail is created with width 175 and height of proportional which comes to 131.
How do I make change, so that thumbnail image is created with height 250 and width is taken proportionally.

woop

Did u tried to leave black (or type "auto") in the Width field on the configuration? It might work pretty fine :)

Please let me know if it works!
Kind Regards,
Daniel Mateu Solé

hk

Leaving width field empty or typing auto, resulted is lot of errors without creating a thumbnail.
Many errors shown for file public_html/administrator/components/com_virtuemart/helpers/img2thumb.php on various lines

woop

I do not know an exact solution to your problem. Anyway as a solution I think that if you do not find a better answer you could just deactivate the picture redimension and just redimension them by height (letting the width be proportional) in your template file by writting in the Html output.

in your default_images.php file as per example the code to display the first image would be like this:
<?php echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', true, "class='modal' style='height:165px; width:auto;'", false, true); ?>

Please notice that I have added the Html code style='height:165px; width:auto;'

The only problem will be that your page will upload bigger images than needed so it will be with more Kb so longer page download....

As another option also maybe you can tell your customer to upload manually the thumb images (this can be done!!)

:)
Kind Regards,
Daniel Mateu Solé

usermee

Hello HK, did you find a decent solution to this problem as I too am having the same issue?
What I have done is set the image width to blank and then under global settings I set error reporting to none, it works fine, however this is clearly not the correct way of doing this properly.
Let me know if you have come up with something better please.

mattyclown


I have searched many posts on resizing thumnail image in Virtuemart, but it seems that none of them talking about the automatic image resizing. So I wonder if you have found a solution to this, would you please share it with us? it will help a lot of people, so thank you in advance.
Quote from: hk on April 18, 2013, 16:19:46 PM
Hi,

I have below settings in Virtuemart Configuration:
Enable Dynamic Thumbnail Resizing? : Yes
Thumbnail Image Width : 175
Thumbnail Image Height : 250

Whenever I upload an image for a product, the thumnail is created and stored in specified folder.

Question:
My image size is 800 x 600. After uploading it, the thumbail image is created of size 175 x 131. The thumbnail is created with width 175 and height of proportional which comes to 131.
How do I make change, so that thumbnail image is created with height 250 and width is taken proportionally.