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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 06-06-2012, 02:12 AM   #1
mochaiso
Member
mochaiso began at the beginning.
 
Posts: 16
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Scaling Images in epubs

Just thought I'd share this for other PRS-T1 users. I found that a few epubs I downloaded from www.archive.org had images in them that would not scale properly on my PRS-T1 screen. I found an old thread here which discussed the issue but seemed to end without a resolution. The main problem appears to be that Sony readers ignore image sizes specified in points rather than pixels. My solution was two fold using Calibre.

First, do an epub to epub conversion within Calibre, use the "Extra CSS" field in the conversion dialog and paste the following:

.img {min-width:300px; max-width:590px; min-height:300px; max-height:790px}

This is still not good enough because for some reason Calibre still wants to specify image sizes in points. Therefore, after the conversion is completed, "tweak" the book in Calibre, open the stylesheet.css file and use a text editor to find/replace all instances of "pt" to "px". Rebuild the book and sideload it to the reader, all the images should now scale down properly.
mochaiso is offline   Reply With Quote
Old 06-07-2012, 03:34 PM   #2
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
Quote:
use a text editor to find/replace all instances of "pt" to "px".
And any font sizes specified in points will now be incredibly tiny!

Better to do a search for img tags and change them by hand. Or at least do your search&replace individually and skip the font size changes.
pholy is offline   Reply With Quote
Old 06-07-2012, 04:59 PM   #3
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
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:
Originally Posted by mochaiso View Post
...use a text editor to find/replace all instances of "pt" to "px". ...
whoa!!! That would cause some serious damage to most English text. The letter pair "pt" is quite common in English words.
dwig is offline   Reply With Quote
Old 06-07-2012, 05:18 PM   #4
AndrewH
Fanatic
AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.AndrewH ought to be getting tired of karma fortunes by now.
 
Posts: 553
Karma: 1234566
Join Date: Jul 2010
Location: Vancouver, WA
Device: Sony PRS-T1, & Kobo Mini
Quote:
Originally Posted by dwig View Post
whoa!!! That would cause some serious damage to most English text. The letter pair "pt" is quite common in English words.
Quite an apx descrpxion of the problem.
AndrewH is offline   Reply With Quote
Old 06-08-2012, 12:33 AM   #5
mochaiso
Member
mochaiso began at the beginning.
 
Posts: 16
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Hmm. I just converted a ~300 pg book this way and I'm about 1/2 way through with no problems in font size. This particular book had about 50 images in it, that's why I utilized the method described. Maybe you are misunderstanding, I am changing all instances of pt to px in the stylesheet.css file that was generated from specifying Extra CSS in Calibre. There were only images specified in that file under each .calibreXX section.
mochaiso is offline   Reply With Quote
Reply

Tags
epub, image, prs-t1, scale, stylesheet.css

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
images stretching on iPad epubs SamL ePub 1 12-22-2011 05:01 AM
problem scaling images paola ePub 11 05-12-2011 02:20 AM
Problem hyperlinking to images in ePubs Curious George ePub 3 11-29-2010 05:19 PM
Adding epubs to iTunes with cover images sartori ePub 31 09-30-2010 12:39 PM
A bug with images in epubs? Cyclops ePub 2 09-13-2010 10:57 AM


All times are GMT -4. The time now is 04:44 AM.


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