Join GitHub today
TinyPNG integration #8
This might be a bit too soon, but wanted to check if it's a good idea to integrate external services too. Let's say you don't have the necessary optimizers installed on the system, but you can still have the option to add your api key and let TinyPNG/TinyJPG optimize the images.
I'm currently using their developer api in a CMS image optimization module I wrote, but would love to swap the custom code out by your library so I can also support the other system optimizers if there are any on the system, and I believe many others would benefit from TinyPNG too.
With TinyPNG you get 500 images for free which is plenty for most of my use cases (and other users) + They do a really good job on compression (and can even crop/resize and do area-of-interest detection but that's not the goal of this package).
Thanks for your suggestion. My aim for this package is that it requires zero setup (apart from the installation of some binaries) and is hassle free.
External services are a bit more complicated to work with:
So I'm going to hold of including such optimizers by default for now.
What you could do is create a separate package that handles optimization with TinyPng. It could contain a class that implements
If you do that, I would probably reference your package in the readme of this one.
Ok thanks! I'll try making a custom optimizer library when I start the rewrite of my CMS module. I really like their compression rate, and although being a lossy compression, the compression not visible.
There's the aspect of dealing with the API key, the limit of 500 images for a free account, and service possibly being down but depends on the project if you can afford having that. If down, I can even fall back on the system optimizers
E.g. the image from the readme (547kB)