PNG to JPG images deleted


I just ran a Smush to convert PNG files to lossy JPG and it deleted the images!!! How do I get them back?


  • Joe Arnao

    Check your Media, see if the image links are broken. Thats probably what happened. Unfortunately if you use this plugin and convert the images from png to jpg, it will convert all images that can save file size from PNG to JPG. This breaks all hard coded URL paths and you end up seeing a broken image logo in it's place. If you didn't back up the images, I'm not sure you can revert the process.

    This is something I've seen happen to people more than once. Once it's changed, the image doesn't even appear in the Media, let alone the surface of the site. You would assume that the plugin would change the files from PNG to JPG without breaking them.

  • Joe Arnao

    I've been searching this support forum as well as Google, and the WP-Smush wordpress plugin support page for any answers.

    Typically, the support team will ask for access to the website to investigate if it's indeed Smush or a third party plugin that is causing the issue. it's expected that you disable any minifying/cache plugins, and then empty your cache on your browser to see if it is a cache issue. If you refresh your page after doing the above, and the issue persists, it means the images within the media library are broken (from my understanding). At this point you'll be requested to use a third party plugin called Regenerate Thumbnails to regenerate your images. This process can take hours depending on the speed of your server and the volume of your images.

    Here is a link to the plugin:

    If you saved a recent backup of you WP Uploads, you can save yourself some time and just do a backup-restore. You can also check to see if you have automatic server backups from your Cpanel, or SnapShot plugin located here on WPMU Dev.

    If by some chance you decided to click the checkbox that saves your original images (doubling your media library size), then you should have a backup of all of the images located somewhere in your server. If not, well then your original images got converted and are now broken.

    From my understanding this is a WP Smush related issue, and this feature should be put in huge red warning for the amount of times it's happened to people. What I don't understand is why converting from PNG to JPG breaks the image INSIDE the media library?, I'm assuming it's because the library assigns permalinks to each upload, and changing the extension of that upload breaks the URL path? Or maybe simply changing a image to PNG breaks the image sometimes? i'm unsure about how the problem occurs, so the options to fixing this issue seem rather limited.

  • Joe Arnao

    I'm not sure what the difference is between the two, I'm still researching the issue as we speak. I'm not saying the plugin will work, however, it might help. I haven't seen enough instances to know whether or not its actually any helpful, I've mostly just seen it referred to by the support staff of this particular plugin when something like this occurs. I'm speaking with support staff now to see what can be done, I'll let you know here once I have definitive answers.

  • Joe Arnao

    I've talked to support.

    The Regenerate thumbnail plugins will not help at all. You have two choices, either restore a backup, or manually go into your Wordpress Database and change all of the broken JPGs back to PNG.

    This feature doesn't seem to have any meaningful uses. Basically, the problem occurs because whenever you upload an image to your Wordpress, it's saved in a Database and is given a static URL path. This WP smush plugin rewrites the IMAGE extension from the file itself, but it doesn't rewrite the URL path from the Wordpress Database as well. I can't even imagine what possible use anyone might have for a feature like this. It needs to be in BRIGHT RED warning signs that the Database URLS will need to be re-written for this feature to even be considered.

  • Rupok

    Hi Thomas and Joe Arnao,

    In WP Smush settings, were you enable this option, there is a Note saying that you will need to update any hard-coded URLs. Please check the attached screenshot for reference.

    But I do agree that it should be shown in a more highlighted way.

    I can see that this post is already created in our Features and Feedback section. So more people liking this idea, more chances our developers will work on this and will include this in our future releases.

    +1 from me.

    Have a nice day. Cheers!