Can I "bulk edit" many books (to compress images)

Asked by Ferante Gu

NOTE: PLEASE PICK THIS UP - THE FIRST PERSON COULD NOT HELP ME!
I have ~1500 books in Calibre and I want to bulk-edit them. I will only use one editing operation on all of them - Tools / Compress Images Losslessly (I also check the lossy option at the default 80). Is there ANY way to do this in bulk, it is killing me to do it one by one. Even if Calibre can't do it, but another program can, please let me know.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu calibre Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

According to the documentation this should be possible with ebook-polish

https://manual.calibre-ebook.com/generated/en/ebook-polish.html

Revision history for this message
Ferante Gu (ferante1) said :
#2

Well, that is something! Never used the terminal but i'll try. Now if you can think of a way that i can have the option checked (the lossy option), that would be my solution. If it can't be done by command, then maybe there is a way to make this option checked in Calibre as a default?

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Disclaimer: I never have tried using this program myself.

There is no "option to be checked", but there is an option for the command line program, see the link to the manual that I gave in my previous comment.

I assume it is
ebook-polish --compress-images input_file [output_file]

Which operating system do you have?
Are the e-books in one directory or located in a directory tree?

You have to build a loop statement to loop over all files (and eventually through all subdirectories)

In Windows it might be something like
for /R %f in (ebookdirectory\*) do ebook-polish --compress-images %f

Revision history for this message
Ferante Gu (ferante1) said :
#4

Hi again Manfred!

I am on a MAC.
I read the link you sent but this is all new to me.
I'd have to know the exact things to say to Terminal, line by line, in order to be able to use this.

Have been looking through the Calibre plugins and options to make the lossy option checked by default - so far, no luck.

Revision history for this message
Ferante Gu (ferante1) said :
#5

To answer your other Qs - i read your link but there was no info there as to how to use the option to enable the lossy option.
My ebooks are all in the main directory in Calibre - however, only some of them need to be resized. I have tagged those with a particular tag.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

This is not an option in calibre, but a separate program!

I have no experience with MacOS, but according to a web search you probably need something like this in a terminal:

for f in $(ls -R yourebookdirectory/*.epub); do ebook-polish --compress-images $f; done

(Repeating the disclaimer: not tried by myself, not sure whether this is correct)

Revision history for this message
Ferante Gu (ferante1) said :
#7

Thank you, Manfred! Now this look like an exact recipe.
Do I put all this on one line?
And it does not solve the issue of the lossy option, correct?
Without it, I only get 15% size reduction - not meaningful to me.

I also see in the plugins list there is an active Polish Book plugin.
But i can't find it in actual Calibre menus.

Revision history for this message
Ferante Gu (ferante1) said :
#8

also, what does f stand for?

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

It seems that I misunderstood your original question when you wrote "I will only use one editing operation on all of them - Tools / Compress Images Losslessly"

According to https://manual.calibre-ebook.com/generated/en/ebook-polish.html this program only allows lossless compression.

If you want higher compression (with quality loss) you have to use something else. I cannot help with that.

Revision history for this message
Ferante Gu (ferante1) said :
#10

I see.
So now I'll number my sub-Qs so they are more visible.

1) Can you help me change the default in Calibre, so that the Lossy option is always checked?
2) Can you help me find the Polish plugin? I see in the plugins list there is an active Polish Book plugin, but i can't find it in actual Calibre menus.
3) can you then ask someone else, or transfer me to someone else, who can find a solution - within Calibre or otherwise?

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

Maybe someone else will answer these questions. I am sorry, but I can't.

Revision history for this message
Ferante Gu (ferante1) said :
#12

What do I need to do so that someone else picks this up?

Revision history for this message
Launchpad Janitor (janitor) said :
#13

This question was expired because it remained in the 'Open' state without activity for the last 15 days.