image_optim icon indicating copy to clipboard operation
image_optim copied to clipboard

Adding PDF optimizing

Open GantMan opened this issue 9 years ago • 2 comments

I had written an optimizer a while ago, much like image_optim. I love it!

One thing we added was PDF optimizations using qpdf. Perhaps that can get added to image_optim? I don't currently have the time, otherwise I'd add it myself.

qpdf --linearize "#{file}" "#{new_file}"

Thoughts?

GantMan avatar Oct 18 '16 14:10 GantMan

Thanks, Gant.

I already had a though about adding pdf optimisation and my main thoughts about this were something like: Pdf is a document format, even if part of pdf documents are just wrapping an image, so should an image optimiser take care of pdfs? And will not it lead to more non strictly image formats been optimised by image_optim.

But from current perspective - image_optim already handles svg format using svgo, and even if by definition it is an image format, it can contain text, so partially a document. So maybe yes, especially if images inside pdf can be optimised, but than this requires a investigation of possibilities and complexity.

toy avatar Oct 18 '16 23:10 toy

Take a playground round with qpdf. I had good results with it. Not sure what other tools are out there. But yeah, image_optim might need to become part of a toolset called assets_optim or something :)

GantMan avatar Oct 19 '16 05:10 GantMan