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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-16-2017, 03:42 PM   #1
oldpal
Junior Member
oldpal began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Apr 2015
Device: iPad
Error viewing e-books in Calibre

Frequently after I add an ePub to Calibre and I try to view it I get the following error message. What is the problem? Thanks.

calibre, version 2.72.0
ERROR: Could not open ebook: Failed to read book, /Users/hugh/Calibre Library/William Stevenson/A Man Called Intrepid_ The Incredible True Story of the Master Spy Who Helped Win World War II (616)/A Man Called Intrepid_ The Incredible True - William Stevenson.epub click "Show Details" for more information

Traceback (most recent call last):
File "site-packages/calibre/utils/ipc/simple_worker.py", line 286, in main
File "site-packages/calibre/ebooks/oeb/iterator/book.py", line 64, in extract_book
File "site-packages/calibre/customize/conversion.py", line 245, in __call__
File "site-packages/calibre/ebooks/conversion/plugins/epub_input.py", line 238, in convert
File "site-packages/calibre/utils/localunzip.py", line 231, in extractall
File "site-packages/calibre/utils/localunzip.py", line 213, in _extractall
File "site-packages/calibre/utils/localunzip.py", line 163, in copy_compressed_file
ValueError: Invalid ZIP file, local header is damaged
oldpal is offline   Reply With Quote
Old 01-16-2017, 04:06 PM   #2
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
"Invalid ZIP file, local header is damaged"

An EPUB is actually a ZIP-file with a different extension, and Calibre needs to be able to read it as such. This file is damaged, and calibre can't unzip/open it. If you do not have this problem with other books, you'll have to redownload the book again and import it again.
Katsunami is offline   Reply With Quote
Advert
Old 01-17-2017, 11:09 AM   #3
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 296
Karma: 1599870
Join Date: Jun 2012
Device: none
You could also try this:

1. Save the file somewhere else.

2. Unzip the file. This is the step most likely to fail, but sometimes even if the zip file header is wrong, you might be able to extract it.

3. If you successfully unzipped it, re-zip the file. Change the extension back to .epub

4. Add the book to Calibre temporarily and try to open it in the viewer.

5. If that works, delete the temporary copy and replace the epub format of the original book with the fixed epub.
fidvo is offline   Reply With Quote
Old 01-17-2017, 05:14 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,155
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
I cant help but think the path to the book seems awfully long..
PeterT is offline   Reply With Quote
Old 01-17-2017, 06:50 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,778
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by PeterT View Post
I cant help but think the path to the book seems awfully long..

One of the reasons I split off (manually) subtitles into a custom column,
KISS (Keep It Simply Short )
theducks is offline   Reply With Quote
Advert
Old 01-17-2017, 08:35 PM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
This ts my path for the same ebook.

Code:
/home/xxxxxxx/test library/William Stevenson/A Man Called Intrepid (804)/A Man Called Intrepid - William Stevenson.epub
Opens and works ok.

bernie
gbm is offline   Reply With Quote
Old 01-17-2017, 08:55 PM   #7
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: 43,839
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
OS X does not have windows' path length limitations
kovidgoyal is offline   Reply With Quote
Old 01-18-2017, 12:27 AM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,548
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by PeterT View Post
I cant help but think the path to the book seems awfully long..
Could be, but after you stick a drive letter and a colon on the front the epub path and wrap it in quotes it is still 'only' 217 bytes long, which is some way short of the 250ish danger zone.

But, I wonder where his %TEMP% folder is, and I wonder how long the xhtml file names are in the book, and are they themselves inside folders. Stripping the subtitle out of the book title in the library manager won't overcome that

@oldpal - if prior suggestions don't help, try assigning the CALIBRE_TEMP_DIR environment variable to a fresh directory with a short pathname - e.g. something like 'c:\_tmp' - see Environment variables

If that works open the the book with the calibre editor with a view to shortening the path lengths within the epub. Or just leave the CALIBRE_TEMP_DIR solution in place.

BR
BetterRed is online now   Reply With Quote
Old 01-18-2017, 01:41 AM   #9
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,155
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
@BR It's a Mac....

Sent from my Nexus 7 using Tapatalk
PeterT is offline   Reply With Quote
Old 01-18-2017, 02:28 AM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,548
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Aaah - I interpreted KG's post as a response to bernies post. Calibre errors on OSX sometimes have a "Darwin" tag in them - don't they, maybe not if its in the viewer. or I dreamt it

Aaah-ha - a clue, calibre reports windows paths with sloshes '\', whereas OSX paths have slashes '/', Linux too I guess; must remember that.

BR

Last edited by BetterRed; 01-18-2017 at 02:40 AM.
BetterRed is online now   Reply With Quote
Old 01-18-2017, 03:04 PM   #11
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by BetterRed View Post
Could be, but after you stick a drive letter and a colon on the front the epub path and wrap it in quotes it is still 'only' 217 bytes long, which is some way short of the 250ish danger zone.
Modern (Windows 7 and beyond) Windows path functions support 255 characters per directory and a total path of 65K characters.

Since Calibre hasn't run on Windows XP for over 100 releases, it should be using all modern path functions.
nabsltd is offline   Reply With Quote
Old 01-18-2017, 03:08 PM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by nabsltd View Post
Modern (Windows 7 and beyond) Windows path functions support 255 characters per directory and a total path of 65K characters.

Since Calibre hasn't run on Windows XP for over 100 releases, it should be using all modern path functions.
I have to agree. I would like proper directory support in Windows.
JSWolf is offline   Reply With Quote
Old 01-18-2017, 04:19 PM   #13
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
The only reason Windows still has a 255 character path limit (per directory, not the entire PATH variable) is to support some very old software. The reason is that in the past, many programming languages such as Pascal used strings as such:

"16this is a string"

The first byte of the string held the length of the string. The above string is 17 characters long, and the first byte denotes the string holds a text of 16 characters.

As a byte only counts from 0 to 255, the text could thus be no longer than 255 characters. To make sure that any programs written in these languages could fit any path returned by DOS within a string, the length of the path was capped at 255.

This limitation has been carried forward for some 35 years now, and I think it's about time it's dropped.

Last edited by Katsunami; 01-18-2017 at 04:21 PM.
Katsunami is offline   Reply With Quote
Old 01-18-2017, 04:43 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,548
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by PeterT View Post
@BR It's a Mac....
Moderator Notice

nabsltd, JSWolf, Katsunami - now that it's been established that the OP is using OSX, could you continue this Windows discussion elsewhere

BR

Last edited by BetterRed; 01-18-2017 at 04:45 PM.
BetterRed is online now   Reply With Quote
Old 01-18-2017, 09:12 PM   #15
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: 43,839
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by nabsltd View Post
Modern (Windows 7 and beyond) Windows path functions support 255 characters per directory and a total path of 65K characters.

Since Calibre hasn't run on Windows XP for over 100 releases, it should be using all modern path functions.
Windows XP also has those modern path functions (though technically speaking, they aren't different functions, just different parameters to the same functions). The problem is not the lack of windows API support for long paths it is that lots of windows software, including windows explorer cannot access paths larger than the old limit.

I dont know why this meme persists on the internet that modern windows has somehow magically learned how to handle long paths. Support for long paths in windows is over a decade old. As of Windows 10 there is now a user controllable registry setting for enabling the old API to also access long paths, but that is totally useless for calibre since something that depnds on a registry setting is not robust.

https://msdn.microsoft.com/en-us/lib...7.aspx#maxpath
kovidgoyal 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
Need help - Error Viewing mscar09 Editor 3 05-25-2015 03:43 PM
Attribute Error Viewing Epub`s Tinderbox (UK) Calibre 9 01-20-2012 05:09 AM
Vox PDF viewing error jo2107 Kobo Tablets 4 12-14-2011 07:38 AM
Error 1155 when viewing a CBR book rob2000 Calibre 3 09-14-2011 06:39 AM
Error viewing lrf format Laurentiu Calibre 2 02-12-2010 05:52 AM


All times are GMT -4. The time now is 07:19 PM.


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