Mobileread
Error when uploading to vendor platforms, and a question about editing the OPF file
#1  jo_by 10-06-2020, 10:59 PM
Kia ora,

I am new to ePub. I'm a graphic designer with some rudimentary html skills, but definitely flying blind in terms of fiddling with code. So much so that I don't really know where to put this question, so sorry if it's in the wrong place.

I have been working on a fixed layout ePub for a design journal. (I should note here that yes, it does need to be fixed not reflowable as it contains several visual essays where the authors have specific requirements around layout – my preference would have been for it to be web-based or in a native app, but that isn't my call ).

It was produced in InDesign and is generally working well. I ended up finding Calibre as I needed a way to resize a heap of pngs that InDesign generated for visual elements like text underlines and overrules – these were causing a problem with vendor platforms as though they are tiny in kb terms, the dimensions of some of them exceeded 4 million pixels. What a headache.

Anyway I worked through that, and now have a single error:

ERROR ITMS-9000: Invalid prefix attribute in root (package) element of the OPF file. Please supply a prefix attribute with valid rendition value in root <package> element of the OPF file

I found the OPF file in 'edit file' and the package bit reads:

<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="bookid" prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/ calibre: https://calibre-ebook.com">

I tried to swap this out for content from an OPF file where this error was not occurring (but the image issue persisted), and saving it:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<package version="3.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/">

But when I reopen the editor, it looks like Calibre strips that out and reverts it to the original.

Any suggestions about what's wrong with that package element? (I have no idea what a prefix attribute is or what is should look like!) And how can I maintain the changes that Calibre seems to want to remove?

Any advice appreciated, especially if it's basic enough for my non-expert skills!

Reply 

#2  BetterRed 10-07-2020, 07:12 AM
Moderator Notice

Calibre can't do much with Fixed Layout epubs

So, I am moving this to ePub forum where the bookmakers hang out.

BR
Reply 

#3  JSWolf 10-07-2020, 07:49 AM
Do your authors realize the problems with fixed layout ePub and how few systems will actually display it correctly?
Reply 

#4  Doitsu 10-07-2020, 08:35 AM
Quote jo_by
Any suggestions about what's wrong with that package element? (I have no idea what a prefix attribute is or what is should look like!) And how can I maintain the changes that Calibre seems to want to remove?
Most commercial Apple Books-compatible books contain package tags like the following one:

Code
<package version="3.0" unique-identifier="bookid" xmlns="http://www.idpf.org/2007/opf" prefix="schema: http://schema.org/ rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/" xml:lang="en-US">
which should work for your book.

You also might want to have a look at the Apple Books Asset Guide.
Reply 

#5  Hitch 10-07-2020, 11:12 AM
Quote jo_by
Kia ora,

I am new to ePub. I'm a graphic designer with some rudimentary html skills, but definitely flying blind in terms of fiddling with code. So much so that I don't really know where to put this question, so sorry if it's in the wrong place.

I have been working on a fixed layout ePub for a design journal. (I should note here that yes, it does need to be fixed not reflowable as it contains several visual essays where the authors have specific requirements around layout – my preference would have been for it to be web-based or in a native app, but that isn't my call ).

It was produced in InDesign and is generally working well. I ended up finding Calibre as I needed a way to resize a heap of pngs that InDesign generated for visual elements like text underlines and overrules – these were causing a problem with vendor platforms as though they are tiny in kb terms, the dimensions of some of them exceeded 4 million pixels. What a headache.

Anyway I worked through that, and now have a single error:

ERROR ITMS-9000: Invalid prefix attribute in root (package) element of the OPF file. Please supply a prefix attribute with valid rendition value in root <package> element of the OPF file

I found the OPF file in 'edit file' and the package bit reads:

<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="bookid" prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/ calibre: https://calibre-ebook.com">

I tried to swap this out for content from an OPF file where this error was not occurring (but the image issue persisted), and saving it:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<package version="3.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/">

But when I reopen the editor, it looks like Calibre strips that out and reverts it to the original.

Any suggestions about what's wrong with that package element? (I have no idea what a prefix attribute is or what is should look like!) And how can I maintain the changes that Calibre seems to want to remove?

Any advice appreciated, especially if it's basic enough for my non-expert skills!
I gotta ask--maybe there's something we can think of, but what sort of design element like an hr or overrule, etc., would actually take up >4M pixels? If these images are huge in the package links folder (I see this horrifyingly often, with designers that never work in digital), have you considered simply resizing those graphics, in the original package file, so that they aren't bigger than they need to be, so that they export smaller, not violating Apple's MPx limits?

I see .tiff files, for example, that are well over 100MB, themselves, some piece of art, that's going to be half-a-page in size, in the print book. I see this sort of cruft all the time. Any chance that these graphic elements are like that?

In terms of changing out the package, Calibre IS going to replace that, simply because you are opening the editor. Try editing it in a regular HTML/text editor, not software like Calibre or Sigil that's part of a software package/program/app that looks to "fix" things for people.

Hitch
Reply 

#6  jhowell 10-07-2020, 05:05 PM
Given that you are committed to using fixed layout, I question your desire to publish in EPUB.

PDF is better supported and leads to far fewer problems.
Reply 

#7  jo_by 10-07-2020, 05:59 PM
Thank you for your responses.

In the end I concluded that Calibre was indeed causing me hassles, so I kept the resized images file and used the top part of an opf file generated by InDesign that hadn't been near Calibre. I finally read the CanCrusher instructions properly so I could reassemble a Zip into ePub on Mac . So it submitted fine. Hitch was on the money, and I had originally done the unzip/fiddle with images/try to rezip but screwed it up. At least Calibre gave be a bit of a look under the hood in the file so I learnt some things.

To address a couple of your points:

Yes, the authors were made aware of the limitations (by me). The book is basically designed to be viewed on iPads or other screen devices, not ePub readers. And I have tested it on those and it does look great. It had to be fixed layout ePub given PDF no longer supports video content and this is a design/art journal that has a lot of image/video (in fact, there is also a pdf version with links to all the video online). Why it isn't in a native app or responsive web only is another question (partly to do with it needing a permanent home, ISBN and DOI), but that is not my call.

This 4 million pixels issue is a known InDesign weirdness and as I said, the file sizes are tiny (a small handful of kb) but the dimensions are enormous. Because in my file these are mostly being generated by text boxes (which are almost the page size and almost entirely transparent) that contain either link underlines, or coloured boxes on footnote superscripts that are basically small flat colour squares it really doesn't matter if they are smaller (because there's no real detail to loose) so just taking the dimensions under 2000x2000px is fine, if laborious, and still looks ok on screen.

So thanks for the help, got there in the end, just I wish I'd read the CanCrusher instructions in the first place (I didn't see you're supposed to just drag the file onto the icon rather than opening it in the programme – duhhh).

Reply 

#8  Hitch 10-08-2020, 02:28 AM
Quote jo_by
Thank you for your responses.

In the end I concluded that Calibre was indeed causing me hassles, so I kept the resized images file and used the top part of an opf file generated by InDesign that hadn't been near Calibre. I finally read the CanCrusher instructions properly so I could reassemble a Zip into ePub on Mac . So it submitted fine. Hitch was on the money, and I had originally done the unzip/fiddle with images/try to rezip but screwed it up. At least Calibre gave be a bit of a look under the hood in the file so I learnt some things.

To address a couple of your points:

Yes, the authors were made aware of the limitations (by me). The book is basically designed to be viewed on iPads or other screen devices, not ePub readers. And I have tested it on those and it does look great. It had to be fixed layout ePub given PDF no longer supports video content and this is a design/art journal that has a lot of image/video (in fact, there is also a pdf version with links to all the video online). Why it isn't in a native app or responsive web only is another question (partly to do with it needing a permanent home, ISBN and DOI), but that is not my call.

This 4 million pixels issue is a known InDesign weirdness and as I said, the file sizes are tiny (a small handful of kb) but the dimensions are enormous. Because in my file these are mostly being generated by text boxes (which are almost the page size and almost entirely transparent) that contain either link underlines, or coloured boxes on footnote superscripts that are basically small flat colour squares it really doesn't matter if they are smaller (because there's no real detail to loose) so just taking the dimensions under 2000x2000px is fine, if laborious, and still looks ok on screen.

So thanks for the help, got there in the end, just I wish I'd read the CanCrusher instructions in the first place (I didn't see you're supposed to just drag the file onto the icon rather than opening it in the programme – duhhh).
Well, yes, if you use INDD to create ttransparent or colored background boxes, rather than using images that are purpose-built in other programs, this can happen.

All that eCanCrusher stuff, lord. It's faster to simply unzip the bloody ePUB, open the images folder and replace the offending images with "better" replacements; I typically run all the PNGs through TinyPNG, which is my go-to Jam for that. So, next time, try opening it in something like NoteTab Pro, so that you don't get that whacky "helpful" Calibre stuff. :-)

Offered FWIW.

Hitch
Reply 

#9  JSWolf 10-08-2020, 06:56 AM
Quote Hitch
Well, yes, if you use INDD to create ttransparent or colored background boxes, rather than using images that are purpose-built in other programs, this can happen.

All that eCanCrusher stuff, lord. It's faster to simply unzip the bloody ePUB, open the images folder and replace the offending images with "better" replacements; I typically run all the PNGs through TinyPNG, which is my go-to Jam for that. So, next time, try opening it in something like NoteTab Pro, so that you don't get that whacky "helpful" Calibre stuff. :-)

Offered FWIW.

Hitch
The Calibre solution is to set the options properly.

Load an ePub into the editor. You will not save it or edit it. Go to Edit > Preferences and then make the following changes and then exit the editor and do not save the ePub if asked.

With these two options deselected, this will prevent any changes made to the ePub when it is loaded into the editor. (IMHO), these two options should be off by default.
Reply 

#10  Hitch 10-08-2020, 10:11 AM
Quote JSWolf
The Calibre solution is to set the options properly.

Load an ePub into the editor. You will not save it or edit it. Go to Edit > Preferences and then make the following changes and then exit the editor and do not save the ePub if asked.

With these two options deselected, this will prevent any changes made to the ePub when it is loaded into the editor. (IMHO), these two options should be off by default.

I'm sure that the OP and others who come later will appreciate that, Jon. I still pretty much just use Calibre as an archival method--shocking, I know, to use it for the purpose for which it was originally intended, but there you go, I'm boring--so I don't know all those editing tricks. :-)

So, thanks for that!

Hitch
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register