Quote:
Originally Posted by xyclonei
This is my assumption on how it works.
If you have a look at .kobo/articles directory, you can see that the images are stored as a UID filename with no extension. The article file (index.html) makes a call to the filename only. If it's JPG encoded, it displays, else it fails.
What this script does is to make an in-place replacement of the PNG file with a JPG one. Since the filename remains, the call to the image should still be valid and will display correctly.
What I want to check though is whether this can be used as a catch-all for any image type.
|
That is absolutely correct. The heavy lifting is done by Pocket, which already seems to convert images. Unfortunately their API is not public, so I haven't had the chance to see what they do exactly.
To use a catch-all, you'd just need to change this line
Code:
if [ "$FORMAT" == "PNG" ]; then
to this
Code:
if [ "$FORMAT" != "JPG" ]; then
Obviously we'd need an ImageMagick with support for more formats