View Full Version : OPF file doesn't like "._"


oblivicat
02-11-2013, 04:54 AM
Hello there,

This is my first post in this forum (probably the first of many). I am the ebook manager for a publishing Press called Ink Pen Mutations. I'm learning how to make ebooks,market them, etc. Not knowing much about this stuff I've been taking Lynda tutorials. The first ebook I'm making is fixed layout style from scratch.

I'm having a maddening problem trying to validate my epub. I'm getting this on all images:

WARNING: test.epub: item (__MACOSX/OEBPS/images/._12_homeless.jpg) exists in the zip file, but is not declared in the OPF file

There is a image file called "12_homeless.jpg". So, something seems to be putting "._" in front of all the images. I'm on Mac so I guess that could be the reason. But, I have no clue how to get rid of the messages. Any help would be appreciated!

tt

Toxaris
02-11-2013, 06:39 AM
How do you create the OPF? Are you sure that the images are declared in the OPF?

DiapDealer
02-11-2013, 07:55 AM
That looks like the hidden "__MACOSX" folder that OSX includes when performing the normal "Archive as" function. That hidden resource folder can't exist in a valid ePub (and still pass validation, anyway). This is one time where doing it "from scratch" is biting you in the ass. Don't create an "archive," create a zip file with the "zip" command—if you insist on doing it from scratch. But I recommend using pdurrant's tool for easily zipping/unzipping epubs (http://www.mobileread.com/forums/showthread.php?t=55681&highlight=tool) properly on OSX, instead. There are special considerations when creating an ePub package (the mimetype file must be first and uncompressed).

Your validator is complaining that the files (that start with "._") in the hidden __MAXOSX folder are NOT declared in the opf. And they shouldn't be; because the hidden __MACOSX folder shouldn't be in the ePub package in the first place.

xrm0
02-11-2013, 12:03 PM
You can also use explodeImplodeEpub to rebuild the epub. You just drop the epub over the application and press rebuild. The new epub is rebuilt without the files on __MACOSX
Here are the details: http://www.mobileread.com/forums/showthread.php?t=203822

(disclaimer: I wrote the application)

oblivicat
02-11-2013, 12:15 PM
How do you create the OPF? Are you sure that the images are declared in the OPF?

I used, and overwrote a sample OPF that Lynda.com supplied. All the images are declared:

<item id="pg11-img" href="images/10_homeless.jpg" media-type="image/jpeg" />
<item id="pg12-img" href="images/11_homeless.jpg" media-type="image/jpeg" />
<item id="pg13-img" href="images/12_homeless.jpg" media-type="image/jpeg" />
<item id="pg14-img" href="images/13_homeless.jpg" media-type="image/jpeg" />

The epub itself works perfectly btw.

Thanks!

tt

oblivicat
02-11-2013, 12:21 PM
This is one time where doing it "from scratch" is biting you in the ass.

Yo DD, this is fantastic! Once I get home from work today I'll try this out and report back.

:)

tt

oblivicat
02-11-2013, 12:24 PM
You can also use explodeImplodeEpub to rebuild the epub. You just drop the epub over the application and press rebuild. The new epub is rebuilt without the files on __MACOSX
Here are the details: http://www.mobileread.com/forums/showthread.php?t=203822

(disclaimer: I wrote the application)

Hey, thanks for the info! Now I've got some ammo to fight the "._"! I'll try this tonight hopefully and report back.

:)

tt

oblivicat
02-12-2013, 11:24 AM
You can also use explodeImplodeEpub to rebuild the epub. You just drop the epub over the application and press rebuild. The new epub is rebuilt without the files on __MACOSX
Here are the details: http://www.mobileread.com/forums/showthread.php?t=203822

(disclaimer: I wrote the application)

Wow! It really is mind-blowing when something actually works. explodeImplodeEpub works like a charm! It got rid of all the extra junk Mac put in. And so easy to use. Thanks so much!!!

tt

JSWolf
02-12-2013, 11:41 AM
Use Calibre with the Modify ePub plugin. Then you can easily get rid of the OS X artifacts.

After that is done, right click the ePub and open file location, copy the ePub and there's your artifact free ePub.