07-27-2017, 09:21 AM | #16 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Rather than an Edit plugin, I'm still of the opinion that people should be writing Output plugins to accommodate this exact sort of scenario. That way, you can keep one standard (and spec-compliant) epub, and then run an Ouput plugin that saves a copy of the epub that is tailored to deal with the quirks of: KDP, Smashwords, iBooks, etc...
Creating Edit plugins that diddle the epub for non-epub reasons doesn't make any sense to me. It means people have to maintain multiple epub versions of the same book to accommodate the various vendor/platform quirks. Using Output plugins would allow content creators to keep one master epub and then squirt out vendor-specific versions on demand. If this images-need-inline-dimensions-in-percentages thing is a consistent expectation of EPUBs bound for KDP/Kindlegen, then it needs to be part of a KDP Output plugin IMO. |
07-29-2017, 03:37 AM | #17 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
As slowsmile told us, some kind of relative calculation can be quite useful for Kindle users. I think this usefulness is not limited to Kindle users because it can also provide a very simple and precise way of displaying images for any Epub. As I wrote above, I make exclusive and systematic use of it with Koreader and with Prince PDF, with consistently good results. As it can be of general use, one could wonder if the result of this calculation could not be included in the Sigil report tool for image files. Currently, this Sigil report namely informs the user about the size of the image, its width and height (in px), and its number of pixels (?). Could we change this last column or just add a new one to indicate the "advised screen size" in percentage? (It could also be named "advised relative width" or any other name). As written on a post above, it would concern only the images whose advised displayed percentage falls under 100%. The purpose of this report is to provide the user with information so this new column would not look out of step with this purpose. The user would decide what to do next with this information and would have to clean its image tags before using it. This latter task can be done using some plain regex. Using this inline style is also practical: as it provides a unique individual value for one image, it seems it makes sense to keep it within its img tag so that the user may be able to modify it directly in code view instead of searching its css file to modify its value. Last edited by roger64; 07-29-2017 at 05:44 AM. Reason: practical |
07-29-2017, 08:52 PM | #18 |
Well trained by Cats
Posts: 29,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
roger64
the size of all embedded images (image files) is in Tools: Reports |
07-30-2017, 01:23 AM | #19 | ||
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Quote:
I must complete this above post: though a regex will be enough to clean every img tag and insert a global percentage inline, it will nevertheless still be necessary to mark manually each image tag with its individual percentage value (to avoid this a plugin has been previously proposed). Last edited by roger64; 07-30-2017 at 02:11 AM. Reason: manually |
||
07-30-2017, 05:35 AM | #20 |
Resident Curmudgeon
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-30-2017, 06:36 AM | #21 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If you're talking about Kindlegen, the Amazon program, you're missing the point entirely (or just being pointlessly obtuse). If you're talking about the Sigil plugin named Kindlegen, then it should only "handle" that which its creator thinks it should handle. Either way, you don't really have a horse in this race, Jon.
|
07-31-2017, 02:19 PM | #22 | |
Bookmaker & Cat Slave
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Why do you think that using that inline will somehow be better than a style in the stylesheet? Hitch |
|
07-31-2017, 02:40 PM | #23 |
Sigil Developer
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
|
I am more worried about creating aspect ratio specific epubs in general. For example, many people read on their phone which may have a 3:4 aspect ratio in portrait mode and a 4:3 ratio in landscape. Similar issues exist with tablets, and of course Desktop machine windows can be almost any width and height that fits on a screen.
By hard coding the aspect ratio into your width calculation, you are penalizing devices if the user decides to rotate their reading mode from portrait to landscape. There simply must be a way to use css without hard coded width percentages that for images that are taller than they are wide, you use max height 100% (forcing the too tall image to be properly scaled down to the height of the device in its current orientation) and similar css for images that are wider than they are tall, that properly handle the current orientation so that images will fit on one page regardless of which way the device is oriented or what aspect ratio is used. What am I missing? Isn't this what Turtle91 is espousing? Does it not work properly for some reason? |
07-31-2017, 03:23 PM | #24 |
Bookmaker & Cat Slave
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
07-31-2017, 05:40 PM | #25 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Using this percentage as an inline style, allows to modify the display very easily. As you use a unique value for each image, I cannot see why it should be better to put it in the stylesheet. The closer this value is from the display, the easier you check it. Last edited by roger64; 07-31-2017 at 05:44 PM. |
|
07-31-2017, 06:15 PM | #26 | |
Bookmaker & Cat Slave
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
It's your workflow, so...don't care. I thought there was some technical reason (rendering, devices, something) for doing what you're doing, but there isn't, apparently. I simply don't understand why you don't just set the width???? In one place, in the CSS? Why not just say img=80%? What is it that the rest of us are missing? Hitch |
|
07-31-2017, 10:13 PM | #27 |
Bibliophagist
Posts: 35,307
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Personally, I tend to use width percentages and height percentages relative to an 600x800 minimum screen resolution so the images appear close to the same size on any of my devices. The samples I've seen in this thread using a max-width expressed in pixels(*). would have my KA1 showing a image less than 50% of the width of the screen while on my old Touch, it would be close to the width and height of the screen (~532x800 for the 626x942 number quoted) if the aspect ratio was maintained.
(*) Pixels like other absolute measurement unit should be banned in ebooks. |
07-31-2017, 10:31 PM | #28 | |
Bibliophagist
Posts: 35,307
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Generally, I don't find using a unique value for each image is needed as very often images are repeated (fleurons. flourishes, vignettes, images used with chapter headers, etc.) or the same image size is used for images inserted into chapters. |
|
07-31-2017, 10:37 PM | #29 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@Hitch...The reason you should put the width percentage value in an inline style is specifically to avoid any tinkering of that percentage by -- specifically -- the Kindle overrides in Kindle ebooks. The latter only applies to images in your ebook that are smaller than 100% of the device screen width/height. So if you put your percentage width into an inline style within the image tag(or even in a surrounding div tag) then the Kindle overrides wont be able to find it. Hence no tinkering occurs.
Last edited by slowsmile; 07-31-2017 at 10:39 PM. |
07-31-2017, 11:29 PM | #30 | ||
Bookmaker & Cat Slave
Posts: 11,460
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
Hitch |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin for inserting endnotes in an epub 2.0 | elibrarian | Plugins | 51 | 12-20-2023 09:28 AM |
Maximize Image Width | Cyberseeker | ePub | 19 | 06-07-2017 02:53 PM |
Changing image width in the economist | goios | Recipes | 1 | 04-24-2014 01:29 PM |
Inserting a background image | roger64 | ePub | 1 | 12-28-2012 06:12 AM |
ADE bug in calculating width | DaleDe | ePub | 6 | 01-17-2010 09:33 AM |