Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TinyPNG

    (@tinypng)

    Hi @swinggraphics,

    Thanks for your feedback! We completely understand why that can be helpful. We made a note of your suggestions and added to our list of possible improvements for the plugin.

    For now, if you don’t want hundreds of large images on the server, you can disable WordPress auto-generating scaled versions of your images. This way you can use the TinyPNG plugin for resizing the original image. Check out the following blog for instructions on how to do so: https://darkog.com/blog/how-to-disable-wordpress-5-3-image-downscaling-feature on how to disable the creation of a -scaled version.

    Hope this helps!

    Thread Starter swinggraphics

    (@swinggraphics)

    I see TinyPNG has a hook for post-processing. Is there a function that is easy to access that I can provide the path to an image, and TinyPNG will compress and replace it?

    Plugin Author TinyPNG

    (@tinypng)

    Hi @swinggraphics,

    Could you please develop your question? For example, in what context do you mean the post-processing hook? WordPress? The developer API?

    Thread Starter swinggraphics

    (@swinggraphics)

    It’s tiny_image_after_compression, but that’s not the question. I am asking if there is a function I can pass a file to that will compress said file. Thanks.

    Plugin Author TinyPNG

    (@tinypng)

    Ok, so you do mean if there is a function, in the context of the WP plugin, that you could call to compress a file when the post-processing hook is called.

    Have you taken a look at the compress_file function?

    Thing is: any image uploaded via WordPress will be compressed automatically by this same function. If you use it on the post-processing hook, you will then trigger the hook again. And you can see where this goes.

    If you want to optimize images that are not uploaded through WordPress, or just tinker with it, you could use the Tinify PHP client (which is bundled with the WP plugin).

    Hope this helps!

    Thread Starter swinggraphics

    (@swinggraphics)

    Well, I don’t want to reinvent the wheel, implementing abstract classes or fussing with configuring an API when the plugin is doing all that heavy lifting already. What it comes down to is, I can’t just pass a file path to compress_file, so I will just have to hope you will add a checkbox option to the plugin that will compress the original, unscaled image.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bulk optimization does not process or remove original, unscaled images’ is closed to new replies.