• Resolved kimbong

    (@kimbong)


    Hi there,

    WooCommerce provides an option to set the size of products’ thumbnail, and width of a single product image.

    However, whenever the uploader uploaded an image with an aspect ratio that’s not 1:1, the single product image on the single product page will be too “long’/”tall” as the image has a higher height to width ratio.

    Is it possible to automatically soft crop or resize it during upload?

    Tried adding this code to the child theme but it doesn’t work.
    “add_image_size( ‘woocommerce_single’, ‘500’, ‘500’, true );”.

    Looking forward to your response. Thank you.

    • This topic was modified 4 years ago by kimbong.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there! ??

    It sounds like the Resize Image After Upload plugin might do the job for you. Here is a direct link to this plugin:

    https://www.ads-software.com/plugins/resize-image-after-upload/

    However, I’m going to leave it open for a bit to see if anyone is able to chime in to help you out with the code.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    I hope this helps ??

    Thread Starter kimbong

    (@kimbong)

    Hi Gabriel,

    Thank you for your response.

    Unfortunately, Resize Image After Upload has an issue with the uploaded image orientation (it will rotate 90 degrees automatically after the image is uploaded. They mentioned in a forum that it was because of how WordPress process the image and there wasn’t much they can do about it.

    however, for those who might have the same problem as I did, I did found a plugin that manages to do the trick, namely “Smart Image Resize for WooCommerce”.

    I’m trying to reduce the number of plugins that we are using as much as possible. So if there is PHP coding that will do the trick. It would help me a lot.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Thank you for sharing the solution with the community @kimbong ??

    Great! If you have any further questions, you can start a new thread.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single Product Page Aspect Ratio Resizing’ is closed to new replies.