Archived topic
problem with woocommerce product image sizing
7 replies · Started by John MacKenzie on May 31, 2019
hi all, ok so having an issue with product image sizing. seems there are 2 settings for this
Customize > layout > woocommerce > single product - product image area width.
why cant this be set as a pixel amount? it seems if i have it set to 40% some images that are too small get stretched REALLY big, while others do not?
there there is a setting in customize > woocommerce > product images, set as a pixel width but this doesnt seem to do anything.
see the product linked below and compare to the product #8bl
is the problem the fact that the first image is too small to start with?
also if you can tell me how to add a bit of padding on the right as the zoom plugin i added seems to cause this to get really close to the text.
thanks!!
The option in Customize > Layout > WooCommerce is just the image area itself - not the actual image. However, WooCommerce forces the images to be 100% of this width.
To prevent that, try this CSS:
.woocommerce div.product div.images img {
width: auto;
}
For the spacing, try this CSS:
.woocommerce #content div.product div.summary {
padding-left: 2em;
}
thanks for following up on this and i didnt reply. Im still struggling with the fact that images on product pages are really tall. Why cant woocommerce have a max height dimension of the image and resize it down to that max setting?
eg this one is way too tall /product/drawing-2/
we cant size images ourselves since its going to be a marketplace and not a lot of control of what the vendors upload.
thanks!
Have you tried their image sizing options in the Customizer?
If you have an example for me to check out, I can see if CSS will help.
HI Tom
the customizer doesnt seem to have height, only width and that doesnt really seem to work with not cropping the image?
thanks!
John
Have you tried the WooCommerce plugin options in the Customizer (not the GP ones)? I think they have image width and height options.
yes i dont see any height options there?
i mean why cant the images just resized scale to a specified dimension in stead of all this cropping or ratio business, thats the only thing that makes sense?
Yea, not sure why they went that route. Image sizing in WordPress is very difficult, so they likely have their reasons.
If you want to link me to a page with an image that needs resizing, I can likely provide some CSS which may do the trick.