Thread: EPUB output
View Single Post
Old 04-09-2009, 11:45 AM   #449
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,411
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by pepak View Post
PRS-505, firmware build 18040.

test.htm:
Code:
<?xml version="1.0" encoding="windows-1250"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250" />
<title>Test</title>
</head>

<body>
<div class="image"><img src="obr1.jpg" alt="" /></div><hr />
<div class="image"><img src="obr2.jpg" alt="" /></div><hr />
<div class="image"><img src="obr3.jpg" alt="" /></div><hr />
<div class="image"><img src="obr4.jpg" alt="" /></div><hr />
<div class="image"><img src="obr5.jpg" alt="" /></div><hr />
</body>
</html>
Images are 3144x4976 (obr1.jpg), 2000x3165, 1500x2373, 1000x1582 and 500x791 (obr5.jpg).

command line:
Code:
any2epub test.htm
The Reader exhibits a very interesting behavior indeed: It says the book has one page, but will happily go through all pages (while showing "1 of 1" in the status bar). But I don't expect Calibre to be able to do anything about that.

As far as rendering is concerned:

- Images 1, 2 and 3 are displayed as empty space approximately 170 pixels high
- Image 4 is displayed cropped to a section from (0, 0) (left, top) to approximately (570, 750) (right, bottom)
- Image 5 is cropped vertically also to about 750 pixels; horizontally, it fits

My conclusion:

1) Very large images are not displayed at all
2) Images larger than screen resolution of the Reader are cropped to fit, not stretched

I can, if you like, try to find the exact dimensions when a picture stops being shown, but considering #2, it seems pointless - if it is too large, it will get cropped (and become unusable) anyway. If the --profile=prs505 is used, the images that are larger than about 600x750 should be resized to this resolution while keeping aspect ratio. Smaller pictures should be left alone.

If possible, this behavior should be used for all pictures - embedded AND cover.
Sure, easy enough to do. Opena ticket with this information and I'll try to get it done for the next release.
kovidgoyal is offline   Reply With Quote