01-16-2017, 03:42 PM | #1 |
Junior Member
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 |
01-16-2017, 04:06 PM | #2 |
Grand Sorcerer
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. |
Advert | |
|
01-17-2017, 11:09 AM | #3 |
Addict
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. |
01-17-2017, 05:14 PM | #4 |
Grand Sorcerer
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..
|
01-17-2017, 06:50 PM | #5 |
Well trained by Cats
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
|
|
Advert | |
|
01-17-2017, 08:35 PM | #6 |
Wizard
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 bernie |
01-17-2017, 08:55 PM | #7 |
creator of calibre
Posts: 43,839
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
OS X does not have windows' path length limitations
|
01-18-2017, 12:27 AM | #8 |
null operator (he/him)
Posts: 20,548
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
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 |
01-18-2017, 01:41 AM | #9 |
Grand Sorcerer
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 |
01-18-2017, 02:28 AM | #10 |
null operator (he/him)
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. |
01-18-2017, 03:04 PM | #11 | |
Evangelist
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
Since Calibre hasn't run on Windows XP for over 100 releases, it should be using all modern path functions. |
|
01-18-2017, 03:08 PM | #12 |
Resident Curmudgeon
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
|
I have to agree. I would like proper directory support in Windows.
|
01-18-2017, 04:19 PM | #13 |
Grand Sorcerer
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. |
01-18-2017, 04:43 PM | #14 |
null operator (he/him)
Posts: 20,548
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
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. |
01-18-2017, 09:12 PM | #15 | |
creator of calibre
Posts: 43,839
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
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 |
|
Thread Tools | Search this Thread |
|
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 |