Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-09-2013, 02:42 PM   #1
ImageSize
Junior Member
ImageSize began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2013
Device: Smartphone - Aldiko
How to specify imagesize in epub

Hallo,

I used Abby Finereader to create a epub document. There are some images in it. Aldiko shows them very small, so you can't see anything. Opened with ezpdf-Reader the Images are bigger and readable.
I know epubs are zips and I think I have to edit main.css to get the Images bigger. But I don't know what to do, it is my first edit of an epub.
Please tell me what to do.

Thank you very much for help.
ImageSize is offline   Reply With Quote
Old 02-12-2013, 03:08 AM   #2
Tex2002ans
Evangelist
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 431
Karma: 360263
Join Date: Jul 2012
Device: Nook
Quote:
Originally Posted by ImageSize View Post
I used Abby Finereader to create a epub document. There are some images in it. Aldiko shows them very small, so you can't see anything.
You will have to open the EPUB and edit the HTML directly (most of us use Sigil to edit EPUBs).

Finereader creates inline HTML for the width/height of the image in this format:

Code:
 <p><img alt="" src="../Images/NameofImage.png" style="width:###pt;height:###pt;" /></p>
If you want to stop the images from being forced into a certain size, you have to remove the section in red. Removing this code will make the image take up its original resolution. In my experience with Finereader, this resolution is at least 1000+ pixels on each side... which is too large for most ereaders.

If you wanted the image to stretch to the width of the reader, you will have to insert code such as this:

Code:
 <div><img alt="" src="../Images/NameofImage.png" width="100%" /></div>
or you can then stretch all images in the EPUB by adding by adding into the CSS:

Code:
img {
    width: 100%;
}
Tex2002ans is offline   Reply With Quote
Old 02-13-2013, 01:24 PM   #3
ImageSize
Junior Member
ImageSize began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2013
Device: Smartphone - Aldiko
Thank you very much. I've made it.
Quote:
<div><img alt="" src="../Images/NameofImage.png" width="100%" /></div>
This version always stretches the image to 100 %. Thats not what I want.
Also that:
Quote:
img {
width: 100%;
}
But
Quote:
img {
max-width: 100%;
}
should do it. I write should, because Aldiko has a bug, where this doesn't work.

So the workaroud for Aldiko that it shows the images in the right size is to add to each <img> tag
Code:
style="max-width:100%"
Example: <img src="main-7.png" alt="" style="max-width:100%"/>
Now it works even with Aldiko. You can use Notepad++ and the function replace in files.
Code:
<img src=(.*?) style=(.*?)/>
<img src=\1/>
This is the first Regex. With that you remove the
style="width:###pt;height:###pt;" which makes Abby.

After that you use
Code:
<img src=(.*?)/>
<img src=\1 style="max-width:100%"/>
And now all your images are correctly displayed.

Last edited by ImageSize; 02-13-2013 at 01:32 PM.
ImageSize is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A New Epub Creator: txt to epub, word to epub oxen ePub 118 06-02-2014 09:44 PM
epub to epub conversion problem with regex spanning multiple input files ctop Conversion 2 02-12-2012 01:56 AM
[Old Thread] Reading epub on viewer inexplicably changes the time stamp of epub greenapple Library Management 20 03-19-2011 10:18 PM
epub, ePub, EPUB, warum blos ePub? flowoeB Lounge 5 11-27-2009 09:37 AM


All times are GMT -4. The time now is 04:45 PM.


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