Support » Plugin: ShortPixel Image Optimizer - Optimize Images, Convert WebP & AVIF » PNG-JPG conversion causing broken images

  • Resolved cjyabraham

    (@cjyabraham)


    I have the “Automatically convert the PNG images to JPEG, if possible” option turned on. It generally works fine, however, there’s a situation where the images break on the front-end of the site:
    1. load the png photos in to a page and keep the edit screen open
    2. on the front-end, the site will initially show the pngs, however, it will soon switch them to jpgs when the jpg conversion has taken place
    3. continue to edit the page without reloading the edit screen
    4. save the page again and you will overwrite the jpg images with the old png filenames so the images will now be broken on the front-end

    Is this a known issue or is there a fix?

    Thanks.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @cjyabraham,

    Could you please send us your site info? It’s on Tools > Site Health > Info. You have a button there to copy it all in one click 🙂

    Also, could you let us know exactly how you add the image to the page? We need to know what modules, blocks or components you use to add the image, and what options to click.

    Thank you,

    Thread Starter cjyabraham

    (@cjyabraham)

    Sure. Here is my site health.

    And to add an image to a page, I drag it into the Gutenberg editor from my computer.

    Thanks for looking into this.
    Chris

    Plugin Support Gerard Blanco

    (@sixaxis)

    Got it, thank you, Chris!

    I’ll forward the issue to our developers and see what we can do with it.

    Thread Starter cjyabraham

    (@cjyabraham)

    Thanks. Is there a way for me to track the progress on this issue?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @cjyabraham,

    I’m sorry, we have a list of tasks but it’s only available to our team. We’ll try to update this post when we find a fix, although feel free to check the changelog every time there is an update!

    Best,

    Thread Starter cjyabraham

    (@cjyabraham)

    Hi. Are there any updates on this issue?

    Plugin Author Pedro

    (@petredobrescu)

    Hello @cjyabraham,

    Apologies for not writing sooner about this. The issue was fixed back in November together with version 5.1.2 of our plugin. Can you please re-check and let us know if you are still facing this issue?

    In short, the fix is that the conversion is now done before the upload finishes. This means the PNG file will only be written to the backups (if enabled), otherwise the image will reach WordPress directly as a JPG, preventing the issue you reported.

    Thanks, I look forward to getting your confirmation about this!

    Thread Starter cjyabraham

    (@cjyabraham)

    Hi Pedro,
    Thanks for the reply. I’ve done some testing on this and have got it to work specifically for the dandelion test image you provide. You’ll see the converted jpg version here.

    I have not, however, gotten the conversion to work for any other PNG image. I read your article on this but still can’t figure out why this image, for example, won’t convert to a jpg. Can you figure out why? I tested on several other images as well but none of them converted to jpg.

    Any thoughts on this?

    Thanks,
    Chris

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Chris,

    I checked your file, and it looks like it contains transparent information. Note that you don’t necessarily have to see transparent pixels; as soon as the transparent information is added to the PNG, you won’t be able to convert it unless you enable the “Also force the conversion of images with transparency” option.

    Best,

    Thread Starter cjyabraham

    (@cjyabraham)

    Ah cool. I now see how to check for the Alpha channel. Ok, I think all good now. We can consider this closed. Thanks for your help.

    Plugin Support Gerard Blanco

    (@sixaxis)

    No problem 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PNG-JPG conversion causing broken images’ is closed to new replies.