0

I been playing with jpegoptim on a ubuntu test server and like the result of its optimization, its there a way to run the optimization command to the new images uploaded through WordPress?

Im aware of all the plugins that do such thing but I really don't like how bloated they are for such simple task.

Thank you in advance!

  • 1
    started to write an answer, but it is really heavily OS and OS shell script related and therefor maybe here is not the best place. Once you have a script that can run your command when files are added or changed, wordpress specific nuances (not sure there are any right now) can be added here – Mark Kaplun Jan 14 '17 at 4:28
  • Great @MarkKaplun. This is WordPress professionals exchange. You can share anything you find attractive and that can be helpful for some other WordPress developer. – prosti Jan 14 '17 at 10:58
  • 1
    @prosti, while the question is on topic, in can be reduced to something which might get better answers on SE or super user. A good answer will require expertise in OS scheduling and shell scripting, something that many here can probably do, but probably none are experts in that – Mark Kaplun Jan 14 '17 at 11:07
  • @MarkKaplun, fully agree with you. There are people who know to appreciate the quality posts and little extra details won't hurt. Whatever you decide... – prosti Jan 14 '17 at 11:30
  • Or, maybe write a php wrapper for calling the binary, and call that wrapper with the add_attachment hook. Similar idea: wordpress.stackexchange.com/questions/12339/… – C C Jan 14 '17 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.