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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-18-2017, 01:38 PM   #1216
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,938
Karma: 1922532
Join Date: Nov 2009
Device: many
Yes, the bug is in mobi_html.py where we explicitly look for url( style pieces in the css but do not handle that case:

Code:
url_pattern = re.compile(br'''(url\(.*?\))''', re.IGNORECASE)

url_img_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)\?mime=image/[^\)]*["')]''', re.IGNORECASE)

font_index_pattern = re.compile(br'''[('"]kindle:embed:([0-9|A-V]+)["')]''', re.IGNORECASE)

url_css_index_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=text/css[^\)]*''', re.IGNORECASE)
I will try to use your example see how to best to handle the missing case of a kindle:flow but with a mime=image/svg+xml.

I think we can easily handle it as a special case by adding a:

url_svg_image_pattern = re.compile(br'''kindle:flow:([0-9|A-V]+)\?mime=image/svg+xml[^\)]*''', re.IGNORECASE)

and then handling it just like we handle inlined css flow urls.

Thanks,

KevinH

Last edited by KevinH; 07-18-2017 at 01:45 PM.
KevinH is offline   Reply With Quote
Advert
Old 07-18-2017, 02:00 PM   #1217
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,938
Karma: 1922532
Join Date: Nov 2009
Device: many
Should be fixed with this commit:

https://github.com/kevinhendricks/Ki...f6bdbf29157b61

Thank you for the bug report and wonderfully simple testcase!
KevinH is offline   Reply With Quote
Old 07-18-2017, 02:07 PM   #1218
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,104
Karma: 22000000
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by KevinH View Post
When you say round-tripped to Mobi are you referring to just an azw3 or to just an older .mobi (mobi 6) format or to the the joint mobi format (with both azw3 and mobi6 versions) or something else?
I used kindlegen v2.9 to create a dual mobi/kf8 file then I used kindleunpack to decode it. The style css file created in the mobi8/OEBPS/Styles directory shows the problem.
jhowell is offline   Reply With Quote
Old 07-18-2017, 02:19 PM   #1219
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,104
Karma: 22000000
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by KevinH View Post
Should be fixed with this commit...
I tried it and it works for me. Thanks!
jhowell is offline   Reply With Quote
Old 08-13-2017, 03:51 PM   #1220
timofonic
Zealot
timofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic somethingtimofonic has a certain pleonastic something
 
Posts: 123
Karma: 18554
Join Date: Jan 2008
Location: Spain
Device: Onyx Boox M96+
Oh. It's great to see KindleUnpack is still alive. Thanks a lot!
timofonic is offline   Reply With Quote
Advert
Old 03-06-2018, 12:19 PM   #1221
raoni.kachille
Junior Member
raoni.kachille began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2018
Device: Kindle
hello im trying to use the program in the comand line and it gives this following error message

(i was trying to use the gui and was getting a error message, then i tried to use directly from the cmd, like the readme tells and this message appeared.)

File "kindleunpack.py", line 1016, in <module>
sys.exit(main())
File "kindleunpack.py", line 992, in main
infile, outdir = args
ValueError: too many values to unpack (expected 2)
raoni.kachille is offline   Reply With Quote
Old 03-06-2018, 12:21 PM   #1222
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 53,350
Karma: 197253854
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage, Yotaphone 2
The command takes two arguments. The file to unpack and the directory to unpack it into. You seem to be giving it more than two arguments, but you haven't given the command you issued, so exactly what's wrong is a mystery.
pdurrant is offline   Reply With Quote
Old 03-06-2018, 03:11 PM   #1223
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 814
Karma: 765432
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
There is some new header field (or other black magic) that decide if book with field 501 = EBOK should be put in Comics not Books category.

None of known comics related fields (122, 123, 127, 128) do that. And no known configuration of EPUB trigger this categorization - Syntax in accordance with Amazon Publishing Guidelines is not enough.

Last edited by AcidWeb; 03-06-2018 at 03:16 PM.
AcidWeb is offline   Reply With Quote
Old 03-06-2018, 04:09 PM   #1224
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 10,972
Karma: 12294882
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by pdurrant View Post
The command takes two arguments. The file to unpack and the directory to unpack it into. You seem to be giving it more than two arguments, but you haven't given the command you issued, so exactly what's wrong is a mystery.
In Linux he might have entered a wild card.

Dale
DaleDe is offline   Reply With Quote
Old 03-07-2018, 12:16 AM   #1225
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,104
Karma: 22000000
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by AcidWeb View Post
There is some new header field (or other black magic) that decide if book with field 501 = EBOK should be put in Comics not Books category.
My best guess is that the "comic" category is not determined by the book contents, but comes from Amazon's servers.

As a test I put my Oasis in airplane mode, bought a (free) comic, downloaded it and copied it to the Oasis via USB. It did not show as a comic. I then turned off airplane mode and synced the kindle. After that the sideloaded book showed as a comic.

As another test I took a book that showed as a comic and made a copy of it with a different (unused) ASIN. The copy did not show as a comic even though the book contents were identical to the original book, other than the ASIN.
jhowell is offline   Reply With Quote
Old 03-07-2018, 02:55 AM   #1226
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 814
Karma: 765432
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
Quote:
Originally Posted by jhowell View Post
My best guess is that the "comic" category is not determined by the book contents, but comes from Amazon's servers.

As a test I put my Oasis in airplane mode, bought a (free) comic, downloaded it and copied it to the Oasis via USB. It did not show as a comic. I then turned off airplane mode and synced the kindle. After that the sideloaded book showed as a comic.

As another test I took a book that showed as a comic and made a copy of it with a different (unused) ASIN. The copy did not show as a comic even though the book contents were identical to the original book, other than the ASIN.
You are right. Sync is editing p_type column in cc.Entries internal database: Entry:Item -> Entry:Item:Comic

Well played Amazon. Forcing remote query to check information that is available in file header.

Last edited by AcidWeb; 03-07-2018 at 03:01 AM.
AcidWeb is offline   Reply With Quote
Old 03-07-2018, 03:20 AM   #1227
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: 32,745
Karma: 9906392
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by AcidWeb View Post
Well played Amazon. Forcing remote query to check information that is available in file header.
Amazon has been doing that for years. The earliest example, I can remember is when they refused to display thumbnails for books unless the thumbnails are downloaded from Amazon even though the files have perfectly good thumbnails in their metadata, this was back in 2010-2011 IIRC

Amazon has been gradually trying to make side-loading less and less pleasant on their platforms for a very long time.
kovidgoyal is online now   Reply With Quote
Old 03-07-2018, 03:24 AM   #1228
AcidWeb
KCC Co-Author
AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.AcidWeb ought to be getting tired of karma fortunes by now.
 
AcidWeb's Avatar
 
Posts: 814
Karma: 765432
Join Date: Mar 2013
Location: Poland
Device: Kindle Oasis 2
Yeah. It is infuriating.
AcidWeb 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
Can i rotate text and insert images in Mobi and EPUB? JanGLi Kindle Formats 5 02-02-2013 04:16 PM
PDF to Mobi with text and images pocketsprocket Kindle Formats 7 05-21-2012 07:06 AM
Mobi files - images DWC Introduce Yourself 5 07-06-2011 01:43 AM
pdf to mobi... creating images rather than text Dumhed Calibre 5 11-06-2010 12:08 PM
Transfer of images on text files anirudh215 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 01:25 AM.


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