View Single Post
Old 06-30-2021, 11:26 AM   #6
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
Quote:
- Is it possible to make a modification that allows you to change the images .png to .jpg in all the selected books, perhaps using an external, free and powerful program like Bulk Image Converter?
- Is it possible to make a modification that allows you to compress the images of all the selected books?
1. I use ImageMagick for this. Open a book in the editor, then select and export all the png images to a working directory. Then at the command line, change to that directory and run
Code:
mogrify -format jpg *.png
. then run
Code:
rm *.png
This leaves you with the jpg images. Go back into the editor and delete all the png images, and import the new jpg ones. Then, in the text files, search for .png and replace with .jpg. (You have to do that so the html knows to display the new files, otherwise you get nothing.) Then do the compression you need. This whole thing usually takes less than a minute, ImageMagick is really fast.

2. "All selected books" is not available either for the conversion or the compression, do it one at a time. I suspect it would be very complex for a plugin to safely do this sort of thing for many books...lots of edge cases, possible coding problems inside the books, and so on. And if a plugin depended on some tool (like ImageMagick or your Bulk thing), how many users' PCs might have that particular too installed? And sometimes I find books with a combination of png and gif (and maybe other) image formats that don't compress well. Or useless images I just want to delete.

I do sympathise with the desire for a bulk utility for this--I have many bloated books I collected before I learned how to do this, and started doing it on adding each such book. But I now look for a lot of things when I add a book, and I don't think I'd trust much mass processing...just my thinking.
retiredbiker is offline   Reply With Quote