03-22-2016, 03:41 AM | #1 |
Connoisseur
Posts: 95
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
|
Case of path different according to the tool used
Hi everyone,
I am not sure where to post this. Occasionally I have an epub where the case of the path is wrong. It is "../images/picture.jpg" and should be ../Images/picture.jpg" Up till now I just changed that manually. As it is rather annoying I thought to automate this process by using the tool powergrep (see www.powergrep.com). And by doing so, I have come across strange things. Using powergrep I search for the literal string (with the option "case sensitive" activated)src="../images/ and replace it with src="../Images/ On testing it finds some files. However, when I open these files with Sigil, in the code view it says the path is: src="../Images/picture.jpg" But, when I open the same epub in Calibre editor, in the code view it says: src="../images/picture.jpg" and in the files browser of calibre editor the image folder is shown with capital "Images". In Sigil AND in calibre editor the picture is shown properly. Is there some sort of explanation for this? I am confused. And how do I go about finding the ones that are truly wrong? Any info would be much appreciated. Last edited by Capricorn; 03-22-2016 at 03:47 AM. |
03-22-2016, 04:37 AM | #2 |
null operator (he/him)
Posts: 20,458
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Capricorn - my, rank layman's understanding is that there is no right and wrong.
Calibre editor shows the files according to type under labels such as 'Text', 'Image' etc but they're not stored within the ePUB in separate directories (folders). Whereas Sigil does store different types of files in different folders. Best way to get to greps with what's going on is to save two copies of the same ePUB from Sigil and Calibre, and then look inside them with an archiver like WinRAR or 7zip. What matters is that the files are named and located as they appear in the manifest. Is one better than the other? Dunno - try the Religion and Politics forum BR |
03-22-2016, 05:23 AM | #3 |
Grand Sorcerer
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
|
03-22-2016, 10:45 AM | #4 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
BTW, many computer file systems are case-insensitive meaning that the path ../images/picture.jpg and ../Images/picture.jpg actually point to the exact same file. This is true on Windows and most Mac (there are case sensitive file systems on Mac you can choose to use). Linux is almost always case sensitive.
That said, the exact path in the URL and in the OPF need to be correct and Doitsu (as usual!) is 100% correct, in that loading the ebook in Sigil, will properly re-map all urls, files, paths files to those fixed inside of Sigil. So Sigil will automatically move all image files into Images. That is by design. You can use the Reports feature and FlightCrew/epubcheck to verify that the manifest entries do exist at their stated urls. KevinH |
03-22-2016, 11:20 AM | #5 |
Connoisseur
Posts: 95
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
|
Ah....things start to become clear now.
I studied an epub after unzipping it first, like Betterred said. And now I see what powergrep actually searches. Depending upon saving an epub with sigil or with calibre editor, the structure changes and hence I need to adapt powergrep to those possibilities as I use both editors. Cool. Thank you very much for all the answers. Much appreciated. Last edited by Capricorn; 03-22-2016 at 11:46 AM. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change case tool | ZoeRochelle | Editor | 12 | 04-04-2014 06:55 PM |
PRS-350 About the epub custom font path And how to know the path? | 52manhua | Sony Reader Dev Corner | 6 | 12-20-2013 01:28 AM |
PRS-950 CASE - Cyber Monday special (900 case that fits) | gardenstate | Sony Reader | 5 | 11-29-2010 01:54 PM |
[Bug] Calibre using all lower case path names | krunk | Calibre | 0 | 05-01-2010 02:58 PM |
Maplin Tool Wallet - Ideal case for PRS-505 | higgs | Sony Reader | 8 | 09-19-2008 04:43 PM |