09-10-2016, 06:25 PM | #1 |
Read, don't parrot.
Posts: 224
Karma: 110242
Join Date: Apr 2011
Device: Kindle Fire, Kobo Touch, Aldiko for Android
|
@#*&^% coding for Apple images
I am looking to update my knowledge as I am now working on an update to a book I put out two years ago that has a lot of images of different sizes...
In Apple's Asset Guide they provide the following guidelines for image handling: HTML: Code:
<div class="image-container"> <img src="images/bears.jpg" alt="three bears peer at goldie locks"/> </div> Code:
img {height: 100%;} .image-container {height: 100vh;} Code:
.image-container2 {width: 100%;} The only way to have both landscape and portrait images in an Apple book, then, was to delete the img class in the CSS and create two different classes that could be applied to the img tag Code:
.vertical {height:100%;} .horizon {width:100%;} Code:
<div class="image-container"> <img class="vertical" src="images/bears.jpg" alt="three bears peer at goldie locks"/> </div> <div class="image-container2"> <img class="horizon" src="images/bears.jpg" alt="three bears peer at goldie locks"/> </div> So what does everyone do now? |
09-12-2016, 07:21 AM | #2 | |
Berti
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Hi,
I don't see a reason to define the Size twice, so "image-container" in my books has only "text-align: center;", nothing else. And, as far as I know, you'll have to define a different class for every size needed, which goes to the <img>-tag Quote:
|
|
09-14-2016, 02:18 AM | #3 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
For whole-screen content, I tend to use a separate HTML page and SVG. It is pretty much the only approach I'm aware of that will make things work robustly (almost) everywhere.
For smaller images, I'd normally expect them to be shown at actual size, rather than specifying size information, and I normally pick the image size to be something reasonable on an average device screen, and just let it be small on other devices. Whether that works or not for you depends on the layout. But if you want to do something more complex than that, then yes, you'd pretty much have to have classes for each image size. Last edited by dgatwood; 09-14-2016 at 02:22 AM. |
09-14-2016, 04:08 AM | #4 |
Fanatic
Posts: 554
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Actually I work on a % for portrait and a different % for landscape. I still use the trick to give the % to a div containing the img, and a 100% to the img. Latest iBooks application do not need this, but I still use the trick for retro-support.
I use external SVG except when I need to hyperlink some content inside the SVG, or when I want to interact svg elements with javascript. |
09-14-2016, 12:19 PM | #5 | |
Read, don't parrot.
Posts: 224
Karma: 110242
Join Date: Apr 2011
Device: Kindle Fire, Kobo Touch, Aldiko for Android
|
Quote:
|
|
Tags |
apple, images |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
EPub validates in Sigil but not in Apple Store & B&N | ralphiedee | Sigil | 8 | 08-08-2012 05:06 PM |
Apple Store Rejecting ePubs with chapter images... | Adjust | ePub | 5 | 12-15-2011 08:57 AM |