View Full Version : cleaning the content.opf file


Adjust
07-27-2010, 07:03 AM
Hi Guys,
I'm having alot of:
"content.opf(67): duplicate resource:"
errors, after creating an epub from InDesign CS3

I can manually delete this image references which fix the problem, but there could be 1000 of them...
here is a screen grab...I've put red dots next to the line that the shouldn't be there...
So for every image in the job it InDesign will duplicate it for every xhtml and so...

eg If you have 10 xhtml files each with 10 images then those 100 image would be duplicated 10 times and throw up that error message....

It's taking forever to clean them up.
There must be an easier way?

http://i980.photobucket.com/albums/ae285/Adjust_02/Picture1-25.png

charleski
07-27-2010, 07:29 AM
Open the .opf in Notepad++ and use a regular expression to replace the erroneous lines with a blank.

I'm guessing that you have 2 images in each chapter, and they're all linked to the same sources on disk. If you want to avoid having to clean up the opf and can accept a bit of bloat in your epub, then a solution might be to create copies of the images with distinct names for each chapter and link to those in your source documents.

I never used CS3 to create epubs, but I do know a lot of people complained about how buggy its epub export filter was. Unfortunately, even CS5 fails to address this issue properly and creates a copy of each repeated image rather than simply linking to a single version.

Adjust
07-27-2010, 07:38 AM
Nuts... I was hoping CS5 (which is in trasit) would have this problem fixed.
I was hoping someone would have made a script or something which would at least get it to a point of Validating (epubcheck+kindleGen).

Yeah, I've been using ^.*-jpeg-.*$ to clean up the lines... But so time consuming...

Jellby
07-27-2010, 08:04 AM
I guess it could be added to the "ePUB fix" plugins in Calibre.

Adjust
07-27-2010, 06:00 PM
I guess it could be added to the "ePUB fix" plugins in Calibre.

Well here's hoping, I can't be the only one out there frustrated by this...
It's a real PITA and takes forever to strip these lines out if you have a image heavy conversion

saytionne
09-01-2010, 04:57 PM
does the ePub fix actually do anything?

Adjust
09-01-2010, 05:54 PM
I don't think it's being added...

It turns out InDesign CS5 fixes most of these issues. Not sure about CS4 though