![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
referenced resource missing in the package
Hi
I opened this thread on the calibre forum because I was puzzled by something. https://www.mobileread.com/forums/sho...d.php?t=236427 It concerns one EPUB file of mine, coming straight from the converter writer2xhtml, and unsaved. Epubcheck reports two referenced resources missing in the package concerning the two otf fonts. If I open the EPUB (with any Sigil from 0.6.2 to 0.7.4), I can see that the two otf files are in the Fonts folder, their relevant item in the manifest (content.opf) has the right src path (../Fonts/xxxx and resource Code:
<item href="Fonts/LinLibertine_R.otf" id="resource5" media-type="application/vnd.ms-opentype" /> <item href="Fonts/LinLibertine_RI.otf" id="resource6" media-type="application/vnd.ms-opentype" /> Code:
@font-face { font-family:'Linux Libertine O'; font-weight: normal; font-style: normal; src: url('../Fonts/LinLibertine_R.otf'); } As you can read Kovid Goyal says that this EPUB is "broken". I have been using writer2xhtml for the last three years and I fail to see what is "broken". Could someone have a look and spot what exactly is "broken"? Last edited by roger64; 03-25-2014 at 10:49 AM. |
![]() |
![]() |
![]() |
#2 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Whenever you take it into Sigil, it restructures the epub to fit its mandatory file structure. It fixes what is broken, which is the path to the file, as I understand it. Calibre does not impose any file structure, so if the path is not right, it will be not right in calibre.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,917
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
are single quotes permitted in a quoted font-family name? (I always use " )
|
![]() |
![]() |
![]() |
#4 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
|
Quote:
YMMV, etc. Albert |
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,223
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
What's broken is simple, unzip that epub and you will see the font files are inside the styles folder, not the Fonts folder. You dont see that when you open it in Sigil, because sigil moves all the files around for when you open the epub.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
AFAK only the files in the opf file. If there is for example an extention wrong (I know...), it gets lost during the opening. This is sometimes used as a kind of social DRM.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks you all for your replies. This comes as a real surprise to me after so many years using writer2xhtml and Sigil. I realize too that the Editor provides no safety net contrary to Sigil.
![]() 1. - So, if I still keep using writer2xhtml, I will need to correct it first by opening it with Sigil and avoid using it first with the calibre Editor. Not a big deal but good to know. 2. - The alternative choice is to manually correct it with he calibre Editor. But there is still something here that I do not get: take my broken EPUB (the one unsaved): I should be able to correct it easily. It's a fairly simple task: I know the good final structure to respect (a Fonts folder, manifest with the right path, @font-face). I tried several times to correct manually the manifest using the calibre Editor, but I failed like if my manual changes were not taken into account. If a direct manual change in the manifest is not possible, what is the recommended way to proceed? I'll move this question to the calibre Editor thread. @st_albert, @theducks Single quotes are OK for fonts, provided you make a consistent use of them in your EPUB. Double quotes are probably more common. @Toxaris I did not know there were such thing as "social DRM". I always thought they were totally wild... ![]() Last edited by roger64; 03-25-2014 at 09:37 PM. |
![]() |
![]() |
![]() |
#8 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
|
Quote:
![]() Next, I've been playing with the files you posted, and first of all, if I convert the .odt file using the stand-alone writer2latex java program (the patch for LO didn't work for me), I don't get any embedded fonts at all. Maybe due to the fact that I don't have those fonts on my system, or due to the specific configuration I have created for writer2latex. (in general we do not embed fonts, so as to simplify our legal obligations.) So no joy there. However, when I use the calibre ebook editor on your pristine epub, I do notice the fact that the fonts are not properly referenced. I edited not the book.opf file, but the styles.css file, and made the references to the font files match what was the real location of the files (e.g. src: url('../styles/LinLibertine_RI.otf'); and so on. Check book also complained about improper mimetypes for the fonts, and also a non-linear item in the spine ( the cover). I had the editor correct these errors individually, and then there were only two warnings re: file too large. These I ignored. I then "saved a copy" of the file. Opening the copy, all errors except the "file too large" errors were now gone. The copy displayed well with the Firefox epub reader, though I didn't test further. Now, granted that OEBPS/styles is not where I would like the font files to be placed, at least it seems to me that corrections can be made in the ebook-edit app that allow a functional ebook to be produced. (BTW, did the original, untouched ebook from writer2epub display correctly? Not having the proper fonts, I couldn't tell. But I would doubt it.) When I have the time, I may try to run your original epub thru sigil (to correct the paths) and see what I see. This may corrupt all the nbsp and nnbsp tags, but as I don't speak French very well I probably won't notice whether the correct font, or the correct spacings are preserved. Maybe others can comment on all of this. Albert |
|
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
The actual location of resource files within an EPUB are arbitrary and hold no meaning or value, other than what we think about it. That being said, I agree with the idea they should be in the right location.
I requested this feature, and Kovid added it: you can now go to Tools ==> Arrange into folders, and specify where each type of file should go; the settings are sticky. |
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
|
Oh, and reguarding "social DRM" if I understand correctly, this concept is not unfamilar to those who grew up with AppleII computers and their feeble attempts at DRM. Namely that it refers to a method of DRM that was not easily defeated by those with merely common knowledge of such things, but was fairly easily defeated by those with a relatively better-than-average understanding of how things worked.
As it happened, it developed that virtually every DRM scheme (I'm using the term DRM loosely) fell into the latter category. Eventually even the pretense of DRM was abandoned by software publishers. (And a shout-out to Beagle Brothers, who never messed with that nonsense to begin with.) (Correct me if I'm wrong -please!- , because I'm always interested in the history of DRM attempts. I'm talking about technology that is WAY in the past, so I'm assuming this will not violate MR's policies!) Albert the ancient, who can sometimes be drawn off topic. |
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
The book works, probably because the references in the HTML files are correct, but if you remove the watermark, files (images) will be missing and therefore cripple the book if you are not careful. I found this out when I cleaned a book I purchased that contained various pictures. |
|
![]() |
![]() |
![]() |
#12 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
The fonts are embedded not on the odt file (which one could do with LibreOffice) but by writer2xhtml which inserts both fonts and an external CSS stylesheet containing among others the @font-face declarations (it's named styles.css in the EPUB). Quote:
One of the very good things of the calibre Editor is that it has a very sharp eye and gives some more warnings that we did not find previously in Flightcrew and Epubcheck. Good to use. Last edited by roger64; 03-26-2014 at 05:13 AM. |
||
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
@roger64: BTW, there's a known bug in Sigil's FlightCrew that'll report unused resources, if the font embedding CSS code is defined in the <head>...</head> section of an .html file instead of a separate stylesheet.
I.e., Sigil expects font embedding code to be defined in a separate stylesheet, which is definitely a good idea in a principle, but not required for valid ePubs. I haven't used writer2xhtml, but if it doesn't create separate stylesheets for embedded fonts, FlightCrew will generate an error, but ePubcheck shouldn't. |
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Doitsu
Thanks for this info. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
container.xml resource is missing | masheen | ePub | 2 | 07-13-2011 10:36 PM |
Referenced Resource missing from package | dgbeig | ePub | 5 | 05-19-2011 03:08 AM |
"referenced resource exists, but not declared" what fixes this? | a-name4epub | ePub | 3 | 12-05-2010 01:12 AM |
PRS-600 Package missing software? | PennyPie | Sony Reader | 6 | 12-24-2009 06:05 AM |
Deluxe package - missing items? | machalla | Bookeen | 9 | 11-08-2007 01:36 PM |