08-17-2012, 09:46 AM | #1 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
EPUB with images. Tweaking inside to make it lighter.
The source odt file coming from outside has been converted with writer2xhtml: the end result is a nice but heavy EPUB file. 25 images. 2.8 megs.
Unzipping and looking the Images folder of the EPUB, I realized that using the mogrify -resize 50% command on the heaviest 10 images (which are not even fullscreen) I could save 1.2meg which would be enough. This is very easy to do, either on the odt or on the EPUB. The first has a Pictures folder, the second an Images folder. However, when I zip back the files, and I try to open the odt file or the EPUB file, it triggers a general error. Is there a way to do this cleanly, I mean in such a way that I could be able to open again the EPUB? (or the odt file)? Or is this behaviour forever forbidden? Last edited by roger64; 08-17-2012 at 09:49 AM. |
08-17-2012, 10:41 AM | #2 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
With thanks to JS Wolf:
When you extract the files from the ePub, do not extract META-INF and metadata. Leave those alone. Then when you put back the rest of the files, the ePub will be compressed correctly (if it was correct before you extracted any of the contents). From another source: Create a new, empty folder with the title of your book as its name, no spaces, all lowercase is best. Zip the empty folder. You now have an empty zip folder. Now you’ll put the pieces of the epub into it, in the right order: First, drag and drop the mimetype file into the zip folder. Next, add the META-INF and the OEBPS folders (you can drag both into the folder at once, their order doesn’t matter, as long as the mimetype file is first). Finally, change the .zip extension on your compressed folder to .epub. So order and compression matter. You could use Sigil, import the new ones with their new names, change the links, then delete the big ones then save. 2.8 meg isn't really so big for a book. If the epub is displayed on something with a bigger screen, the images might look better, though managing it so they don't overrun your Sony and still look good on a bigger screen can take some doing. |
08-17-2012, 11:53 AM | #3 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@mrmikel
I failed with both methods once. Then had success with the second one (new empty folder...) proceeding more slowly. Solved. Thanks very much for your detailed reply. |
08-17-2012, 01:57 PM | #4 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The real question is now that the images are compressed a LOT more, how do they compare? Do you see compression artifacts? Are they not as clear?
|
08-17-2012, 02:21 PM | #5 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Out of 25 images, I selected the 10 heaviest who were not even fullscreen. Their total weight went from 1,6M to 437k.
I really cannot see any difference in display on IPAD size screen. This procedure is very handy to know. |
08-17-2012, 03:30 PM | #6 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Don't use the term weight. That's nothing to do with what you are doing. You are changing the compression and the filesize.
Can you post a couple of images before and after so we can see if we can see anything. Sometimes it's hard to see things in detail underneath the fog of fingerprints on an iPad. |
08-18-2012, 05:08 AM | #7 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Images are copy protected and the best I can do is to send thumbnails. Hope this is OK. Sorry for that. |
|
08-18-2012, 06:41 AM | #8 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Heavy, dude! (grin) Unless you know you are just creating material for an ipad pretty much for your own use, it is worthwhile to check on another device or viewer, like even ibook. The images could be a lot less satisfactory on such a larger device. That is why I leave color if present from the originals, though my little Sony won't display it.
Wolfie's concern, in addition to the proprieties, which should be observed at all times, is that weight is something which is generally used with fonts. To describe images as heavy might imply darkness or saturation of colors when applied to images to some people's minds. |
08-18-2012, 09:43 AM | #9 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
You are both technically right on it, of course and I never do it again. I shall pay due respect to the right of propriety. Thank you very much. |
|
08-18-2012, 10:15 AM | #10 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'd wait until there's evidence of confusion before changing your "argot." I have a hard time imagining anyone (anyone capable of helping/contributing to the thread, that is) who wouldn't be easily capable of determining what you meant by "weight." No need to cater to pedantry on every occasion.
|
08-18-2012, 11:26 AM | #11 | |
Wizard
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Quote:
Using non-standard terms hinders other users from finding the information later and is effectively anti-social. Helpful members that reply to such initial posts should provide the proper "translation" as part of their response (e.g. "By 'weight' I presume you mean 'file size' ", ...) so that there is some hope that a later Search will find the post. |
|
08-19-2012, 05:04 AM | #12 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
Quote:
Here is an automatic solution which may be more convenient. I join some test images as asked to allow you to check if the images are fit for an EPUB display. This mini-script makes use of Image Magick. Put the files to modify in one folder on your path. It will create a folder, named nouveau, and inside, it will insert files whose size have been reduced so as not to overcome 600 pixels in width or 800 pixels in height. All the files inside the test folder have the .jpg extension. Of course, you can change all these values above according to your needs. Don't forget to press Enter in the terminal. The joint folder essai contains 12 images (8,5 megs). The folder nouveau contains the same 12 images but with a reduced size (1.14 meg). Code:
mkdir nouveau for FILE in *.jpg do convert "$FILE" -resize 600x800\> nouveau/"$FILE" done Last edited by roger64; 08-19-2012 at 05:32 AM. |
|
08-19-2012, 07:29 AM | #13 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
There is a free program, among others, called irfanview. One of its several functions is bulk actions on graphics files, such as resizing. This is additional option for Windows users needing to resize many files as well. As Wolfie noted, you have to be careful not to create a lot of jagged blurry pictures through too much conversion.
|
08-19-2012, 08:21 AM | #14 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Note: I am a Linux user and Irfanview 4.33 (latest) does not run with Wine (some former versions did). Edit: Portable version is working. There is also to do this (among many other things) another fine GUI program running on all platforms: xnconvert Last edited by roger64; 08-19-2012 at 10:38 AM. |
|
08-19-2012, 07:53 PM | #15 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Thanks for the pointer to this program and its brother xnview. They both look capable and useful.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cover & inside images in epub on different readers | JoanneM | ePub | 21 | 07-03-2012 08:39 PM |
How to make TextView inside ViewPager scroll vertically | polygrimm | Android Developer's Corner | 0 | 07-03-2012 07:59 AM |
Rebuild ePub after tweaking | hollowayhouse | Conversion | 8 | 08-05-2011 08:09 PM |
"Conversion of WMF images is not supported" message inside converted book | FF2 | Conversion | 8 | 04-11-2011 11:08 AM |
Can you make a folder inside a Collection on Kindle? | davtay | Amazon Kindle | 20 | 01-14-2011 10:52 PM |