Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2009, 10:21 AM   #781
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by tompe View Post
There is a flag "--imagerescale 0" which I think will disable all scaling. I checked th code now and from the code without actually testing I draw that conclusion (so i might be wrong...).
It does work. For maps, etc, I get dramatically better quality in the final book by using "--imagerescale 0". That's one of the reasons I wanted to try out "opf2mobi", because in Mobi Creator there's no way to stop the image quality being degraded to get the image under 64k.
HarryT is offline   Reply With Quote
Old 06-11-2009, 10:21 AM   #782
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by tompe View Post
There is a flag "--imagerescale 0" which I think will disable all scaling. I checked th code now and from the code without actually testing I draw that conclusion (so i might be wrong...).
I think you are wrong.

In MobiPerl/Util.pm, there's this:

Code:
    # pdurrant
    # do not resize large images if the filesize is OK,
    # even if pixel dimensions are large
    if ($filesize < $maxsize and
       ((not $rescale_large_images) || ($x <= $maxwidth and $y <= maxheight))
       and $type ne "PNG"
       and (not defined $scale_factor or $scale_factor == 1.0)) {

       # No transformation has to be done, keep data as is
       ...
    }
That's where I want the program to enter, but the condition is "if $filesize < $maxsize" and other things. I want that even if the filesize is larger, so I had to modify the if and make it:

Code:
    if (($filesize < $maxsize and
        ((not $rescale_large_images) || ($x <= $maxwidth and $y <= $maxheight))
        and $type ne "PNG"
        and (not defined $scale_factor or $scale_factor == 1.0)) or (not $rescale_large_images)) {
which is not perfect (it won't touch PNGs, which it should), but it works for me.
Jellby is offline   Reply With Quote
Advert
Old 06-11-2009, 12:08 PM   #783
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by Jellby View Post
I think you are wrong.
Jellby, you are right! Not that I'm taking sides...

In my modified html2mobi.pl file that I call from within PDFRead, I sort of disable the automatic Palm image quality reduction which "fits" images within its maxsize (60K) by upping the maxsize to say, triple, that i.e. 180k.
Code:
- In MobiPerl/Util.pm, changed bold part:
       my $maxsize = 61000*3;
It is a nice tradeoff between too high quality in .mobi ebooks and inferior .jpg quality artifacts. Obviously this "fix" will break for Palm devices.
nrapallo is offline   Reply With Quote
Old 06-11-2009, 12:18 PM   #784
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
This is strange. My memory says that I allowed larger images in term of number of bytes but the code as you point out seems to say something else. I remember being very unwilling allow it but thought I gave in... I might just add a new flag...
tompe is offline   Reply With Quote
Old 06-11-2009, 12:31 PM   #785
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by tompe View Post
This is strange. My memory says that I allowed larger images in term of number of bytes but the code as you point out seems to say something else. I remember being very unwilling allow it but thought I gave in... I might just add a new flag...
Your memory is correct; you allowed larger images NOT to be resized/rescaled with that flag, but never took care of the secondary .jpg quality reduction to "fit" the Palm maxsize resitriction. At least, this is how *I* remember it.
nrapallo is offline   Reply With Quote
Advert
Old 06-11-2009, 12:56 PM   #786
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Curious. Why is it I wonder, in that case, that my maps, which are >64k in size, look so much better with "imagerescale=0" set? It really is a huge quality difference; text which is "blurry" with the default setting is clear and sharp with the flag set.
HarryT is offline   Reply With Quote
Old 06-11-2009, 01:02 PM   #787
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by HarryT View Post
Curious. Why is it I wonder, in that case, that my maps, which are >64k in size, look so much better with "imagerescale=0" set? It really is a huge quality difference; text which is "blurry" with the default setting is clear and sharp with the flag set.
Perhaps they are larger than 640x480 pixels too?

There are these maxima:

Dimensions: 640x480 pixels, it can be disabled with "--imagerescale 0"
Filesize: 61440 bytes, it cannot be disabled with a flag (yet).

If you want to test, run mobi2html on the generated mobi, and you'll see whether the image files were modified or not.
Jellby is offline   Reply With Quote
Old 06-11-2009, 01:04 PM   #788
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by Jellby View Post
Perhaps they are larger than 640x480 pixels too?

There are these maxima:

Dimensions: 640x480 pixels, it can be disabled with "--imagerescale 0"
Filesize: 61440 bytes, it cannot be disabled with a flag (yet).

If you want to test, run mobi2html on the generated mobi, and you'll see whether the image files were modified or not.
Thank you, yes, that will be the reason. They are 800x600 images.
HarryT is offline   Reply With Quote
Old 06-11-2009, 04:51 PM   #789
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by Jellby View Post
Dimensions: 640x480 pixels, it can be disabled with "--imagerescale 0"
I think the bug is fixed in the Cybook so I will change the default to disabled.
tompe is offline   Reply With Quote
Old 06-11-2009, 05:09 PM   #790
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Since I have fixed some "bugs" I did a version 0.41 which is available at

https://dev.mobileread.com/trac/mobiperl/

Let me know if I broke something (I have not tested it so much...)

Changes in 0.0.42
  • Added flag --allowtts to mobi2mobi
  • Added flag --deleteclippinglimit to mobi2mobi
  • Enhancement and bug fixes in Opf.pm (goto toc now works and it recognize more cover image tags)
  • Opf.pm: Removed BOM (byte order mark) from opf file data
  • --imagerescale default is now 0 (disabled rescaling)
  • Added flag "--imagemaxbytes n" to specify the maximum size of image data included in the mobi file.
Anybody feel free to build Windows binaries and upload them here...

Last edited by tompe; 06-11-2009 at 05:14 PM.
tompe is offline   Reply With Quote
Old 06-11-2009, 05:41 PM   #791
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Changing user name to 'Anybody' in 5, 4, 3, ... :-D
Attached Files
File Type: zip mobiperl-win-0.0.42.zip (9.82 MB, 980 views)
Gudy is offline   Reply With Quote
Old 06-11-2009, 05:48 PM   #792
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by Gudy View Post
Changing user name to 'Anybody' in 5, 4, 3, ... :-D
Thanks
tompe is offline   Reply With Quote
Old 06-11-2009, 05:58 PM   #793
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by Gudy View Post
Changing user name to 'Anybody' in 5, 4, 3, ... :-D
Either that or 'Always'...

Thanks a bunch!!!
nrapallo is offline   Reply With Quote
Old 06-12-2009, 03:08 AM   #794
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
If someone could build Windows binaries I'd be grateful - I don't have PERL installed on my PC .

Edit: Ignore me - I'm overlooking what's right in front of me .

Last edited by HarryT; 06-12-2009 at 03:55 AM.
HarryT is offline   Reply With Quote
Old 06-12-2009, 11:02 AM   #795
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by tompe View Post
Since I have fixed some "bugs" I did a version 0.41 which is available at

https://dev.mobileread.com/trac/mobiperl/

Let me know if I broke something (I have not tested it so much...)

Changes in 0.0.42
...
Is it 0.0.41 or 0.0.42? And how are we supposed to download it? The download link only gives a changeset zip file, with README and Makefile.

Ah... I see, it's the other link.
Jellby is offline   Reply With Quote
Reply

Tags
mobi2mobi, mobils


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools Jad Kindle Formats 476 03-15-2015 05:51 PM
Tools for Editing Kindle .mobi Files? GJN Kindle Formats 33 12-26-2013 02:05 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 11:49 AM
PRS-500 Perl tools to generate Reader content TadW Sony Reader Dev Corner 0 01-08-2007 05:55 AM
gmail copy (gmcp) - Perl script to copy files to/from Gmail Colin Dunstan Lounge 0 09-04-2004 01:24 PM


All times are GMT -4. The time now is 08:42 AM.


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