View Single Post
Old 05-31-2022, 07:49 AM   #6
qkqw
Connoisseur
qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.qkqw is at one with the great books of the world.
 
Posts: 67
Karma: 143000
Join Date: Apr 2022
Device: Kobo Libra 2
Quote:
Originally Posted by xyclonei View Post
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
qkqw is offline   Reply With Quote