Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 03:45 PM   #1
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
Bulk CSS Edit?

Hi,
I'm trying to work through the issue of stretched covers showing on my Kobo Libra Colour. I've come from having a Kindle, where all covers looked fine.

I have spent two full days trying to solve this issue, and I've been through every piece of advice I could find on the internet but nothing helped until I finally had a breakthrough (ChatGPT would you believe) and by entering into the book editor, clicking on the title page and changing the CSS from 'keep aspect ratio' from 'none' to 'yes', that has been the only thing that has worked.

But, I need to do this for my whole library, and I can't figure out a way to do this bulk. If I select a number of books and open Editor, it just opens a window for each of the books. I have quite a big library (1000+) but I can't seem to figure out how to assign 'yes' to aspect ratio within the CSS for all books at once.

So grateful for any help, starting to lose the plot.
HFM1101 is offline   Reply With Quote
Old Yesterday, 03:53 PM   #2
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 14,859
Karma: 245111335
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Did you try checking the box "Keep cover aspect ratio" in the Kobo driver settings?
Sirtel is online now   Reply With Quote
Old Yesterday, 03:57 PM   #3
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
Yes, I've tried all the things I could within the menus for keeping aspect ratio, and I've tried polishing, and updating metadata, etc. Nothing has worked except changing the CSS. I'm not familiar enough with CSS to understand all this. I really hoped there would just be a quick solution to this. I can't change CSS individually though for all the books, it would take too long. And I'd also have to do that for every new book I'd put on, too. There must be an easier way.
HFM1101 is offline   Reply With Quote
Old Yesterday, 04:00 PM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,794
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by HFM1101 View Post
Hi,
clicking on the title page and changing the CSS from 'keep aspect ratio' from 'none' to 'yes', that has been the only thing that has worked.
If your cover page is created using svg code, then you should see the attribute preserveAspectRatio.
Ensure the value is set as this... preserveAspectRatio="xMidYMid meet"
Not sure about your comment "none" to "yes" and where you are changing that.

When importing an ebook into Calibre, you are given the option to preserve the cover image aspect ratio. You obviously have this unselected.
See image...

As for batch editing all books in your library to fix this problem, I have no idea if that is possible.
Attached Thumbnails
Click image for larger version

Name:	PreserveAR.jpg
Views:	20
Size:	75.0 KB
ID:	221897  
Karellen is online now   Reply With Quote
Old Yesterday, 04:15 PM   #5
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
Quote:
Originally Posted by Karellen View Post
If your cover page is created using svg code, then you should see the attribute preserveAspectRatio.
Ensure the value is set as this... preserveAspectRatio="xMidYMid meet"
Not sure about your comment "none" to "yes" and where you are changing that.

When importing an ebook into Calibre, you are given the option to preserve the cover image aspect ratio. You obviously have this unselected.
See image...

As for batch editing all books in your library to fix this problem, I have no idea if that is possible.
...feeling incredibly stupid right now... and very grateful, thank you.

To answer your question, where you said to set value to 'xMidYMid', that is where I was putting in the word 'yes' and it worked.

Thank you for the picture. My oversight is due to the fact that when I originally converted all azw3 files to epub a week ago, and then transferred the epubs into new library, I haven't had to convert anything since then as books are auto converted to kepub on transfer. So, I haven't thought to look back into the convert section. I'd put the face palm emoji here if I had the option.

Anyway, egg on face, but thank you so much.
HFM1101 is offline   Reply With Quote
Old Yesterday, 04:18 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,484
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I have a very simple solution that will work very well. Use the Modify ePub plugin. There is an option to insert or replace the cover. IT does as little as possible to change any of the code. See the screen grab to see what the option is you'd need to select in order to fix the cover. You can do this for multiple ePub in one go. It works very well. It will keep the correct aspect ratio. This is the best solution for updating the cover for ePub.

Click image for larger version

Name:	Modify ePub.jpg
Views:	10
Size:	177.4 KB
ID:	221898
JSWolf is online now   Reply With Quote
Old Yesterday, 04:34 PM   #7
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
Quote:
Originally Posted by JSWolf View Post
I have a very simple solution that will work very well. Use the Modify ePub plugin. There is an option to insert or replace the cover. IT does as little as possible to change any of the code. See the screen grab to see what the option is you'd need to select in order to fix the cover. You can do this for multiple ePub in one go. It works very well. It will keep the correct aspect ratio. This is the best solution for updating the cover for ePub.

Attachment 221898
Thank you very much Jon. I think you must have been writing this as I hit 'send'... so, problem solved, but appreciate very much your help.
HFM1101 is offline   Reply With Quote
Old Yesterday, 04:39 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,484
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by HFM1101 View Post
Thank you very much Jon. I think you must have been writing this as I hit 'send'... so, problem solved, but appreciate very much your help.
Modify ePub is a very excellent plugin. I use it a lot.
JSWolf is online now   Reply With Quote
Old Yesterday, 04:45 PM   #9
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
I am now re-converting my original azw3 library to epub with the aspect ratio box firmly checked.

In future, when I have epub books to begin with (that don't need converting) would I still convert from epub to epub just so I could check that aspect ratio box? And if so, do I lose anything in the file by converting to the same format again? Thanks.
HFM1101 is offline   Reply With Quote
Old Yesterday, 04:52 PM   #10
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,794
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by HFM1101 View Post
...feeling incredibly stupid right now... and very grateful, thank you.

To answer your question, where you said to set value to 'xMidYMid', that is where I was putting in the word 'yes' and it worked.

Thank you for the picture. My oversight is due to the fact that when I originally converted all azw3 files to epub a week ago, and then transferred the epubs into new library, I haven't had to convert anything since then as books are auto converted to kepub on transfer. So, I haven't thought to look back into the convert section. I'd put the face palm emoji here if I had the option.

Anyway, egg on face, but thank you so much.
No problems, we all make bloopers at times. I've made some great ones to be proud of
You learn and move on.

No idea why "yes" works. I guess it is some good error handling by the ereader software.
More info... https://developer.mozilla.org/en-US/...rveAspectRatio

As for converting and reconverting. I guess it introduces more and more code in the ebook.
In some simple books I have edited that have used only 4 css styles, after conversion I end up with 15+ styles. So I would avoid the re-conversions.
Karellen is online now   Reply With Quote
Old Yesterday, 04:55 PM   #11
HFM1101
Enthusiast
HFM1101 began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2018
Device: Kindle Voyage, Kobo Libra Colour
Quote:
Originally Posted by Karellen View Post

As for converting and reconverting. I guess it introduces more and more code in the ebook.
In some simple books I have edited that have used only 4 css styles, after conversion I end up with 15+ styles. So I would avoid the re-conversions.
Thanks, make me feel a bit better!
So, if not re-converting, do I have to opt for inserting the value you already spoke about in the 'preserveaspectratio' area, for every individual book?
HFM1101 is offline   Reply With Quote
Old Yesterday, 05:29 PM   #12
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,794
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Yes, best to do it manually. And I am referring to the epub to epub conversions.
Your azw to epub conversions are first generation conversions so you can reconvert without harm.
Maybe try jswolf method. I can’t advise on that as I’ve never used that method or plugin.
Karellen is online now   Reply With Quote
Old Yesterday, 05:51 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,484
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by HFM1101 View Post
I am now re-converting my original azw3 library to epub with the aspect ratio box firmly checked.

In future, when I have epub books to begin with (that don't need converting) would I still convert from epub to epub just so I could check that aspect ratio box? And if so, do I lose anything in the file by converting to the same format again? Thanks.
You do not need to convert ePub > ePub. Retail ePub has the cover at the correct aspect ratio. However, if you get a generic cover or want to change the cover, use Modify ePub by first replacing the cover in Edit metadata.
JSWolf is online now   Reply With Quote
Old Yesterday, 06:17 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,493
Karma: 32600658
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Or use calibre's built-in Polish function - press 'P':

Click image for larger version

Name:	Screenshot 2026-03-20 091100.jpg
Views:	7
Size:	135.5 KB
ID:	221899

BR
BetterRed is offline   Reply With Quote
Old Yesterday, 06:20 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,484
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by BetterRed View Post
Or use calibre's built-in Polish function - press 'P':

Attachment 221899

BR
Heck no. That changes more code then Modify ePub. Modify ePub is designed to change as little code as possible.
JSWolf is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk edit SVG ElMiko Calibre 3 11-30-2025 02:28 PM
How to bulk edit identifiers? stardot Library Management 1 01-07-2021 03:14 PM
Bulk Edit Title tarisea Library Management 2 04-19-2018 01:11 AM
Bulk edit of identifiers rmagere Library Management 4 02-19-2012 04:10 AM
Bulk metada edit error trying to edit tags Purple Lady Calibre 8 02-17-2011 06:09 PM


All times are GMT -4. The time now is 03:00 PM.


MobileRead.com is a privately owned, operated and funded community.