|
|
#1 |
|
Connoisseur
![]() Posts: 84
Karma: 10
Join Date: Jul 2023
Device: none
|
Problem with delete unused media files
Load the attached epub and select tools/delete unused media files. It says that cover.jpeg is unused even though I can see it in the preview window. If I set it as the cover image, it works. This happens on Sigil 2.6.2 and 2.7.0
|
|
|
|
|
|
#2 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,121
Karma: 6404930
Join Date: Nov 2009
Device: many
|
Using exact (case sensitive) matching?
Not a bug. cover.jpg is not equal to Cover.jpg Code:
<div><div><img src="cover.jpeg" alt="" style="width:100%;"/></div> But BookBrowser shows the file is actually called "Cover.jpg" All urls use case sensitive paths. This is the spec. Are you on Windows with a case insensitive file system? Epubcheck should easily detect this case and report it. Last edited by KevinH; Yesterday at 12:27 PM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,413
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I see this all the time when I use an image fleuron in a chapter/scene break. html: <hr class="ChDiv"/>
Sigil won’t detect an image that is used via css. Eg. background src. So watch out for those. Reports show the fleuron used 0 times. |
|
|
|
|
|
#4 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,121
Karma: 6404930
Join Date: Nov 2009
Device: many
|
Sigil should detect if an image is only used in background src in css if the case is an exact match when "deleting unused media" is run. If it doesn't that is a bug!
Or is this issue only happen in Reports? Either way, please post a short epub test case and I will try to track this bug down and fix it for the next release. Thanks! Last edited by KevinH; Yesterday at 12:45 PM. |
|
|
|
|
|
#5 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,121
Karma: 6404930
Join Date: Nov 2009
Device: many
|
Okay, I checked the Images Reports code and the count value in that Report is only for direct usage by html files not css files. I will expand that count to include direct usage in css files as well in the Images report.
Deleting Unused Media does not use the Reports values in any way. As long as your css includes a proper url() in its property value, it should be handled properly by delete unused media. Either way a test case would help. Last edited by KevinH; Yesterday at 01:05 PM. |
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Connoisseur
![]() Posts: 84
Karma: 10
Join Date: Jul 2023
Device: none
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,121
Karma: 6404930
Join Date: Nov 2009
Device: many
|
Windows (all versions) uses a case insensitive but case preserving file system. Linux is case sensitive and MacOS can easily be either depending on how you format the drive.
So on Windows when Sigil asks for "cover.jpg" the file name returned by the OS could be any of the following as all these names map to the exact same file: cover.jpg Cover.jpg COVER.JPG CoVeR.jPG ... etc. The spec for interpreting a url that resolves to a file path is that it must match in a case sensitive manner: "cover.jpg" only matches to "cover.jpg" and no other variations. So Windows sees Cover.jpg as the same file as cover.jpg but this is specific to Windows and may not happen in most standalone e-reading devices that are Linux based. Again, epubcheck checks for mismatches like this to alert you to fix it. Many developers hate case insensitive file systems and try to avoid them to prevent inadvertant overwriting of files. In my opinion, Windows still being case-insensitive is a real point of aggravation, and something Windows 11 should have finally fixed, but did not. If you ever format a drive in Windows, there must be a way to create a real case-sensitive file system. It is really easy to do on a Mac. I use a case sensitive file system on my Mac and the "cover.jpg" in your epub does not appear in Preview since it does not exist. It also would break under other e-readers. So stick to case sensitive file names and never use a filename that only differs by case (upper vs lower) of some of the letters, if you want your epub to work everyplace. Last edited by KevinH; Yesterday at 05:48 PM. |
|
|
|
|
|
#8 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,767
Karma: 174510638
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
After cleaning up all the errors around id values in the toc.ncx, epubcheck returned the following:
Code:
main.xhtml 10 338 Col: 61: ERROR(RSC-007): Referenced resource "cover.jpeg" could not be found in the EPUB. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete Unused Stylesheet Selectors selects all my styles. | jwes | Sigil | 4 | 05-29-2025 02:28 PM |
| SVG images marked as "unused media" | AlanHK | Sigil | 5 | 09-02-2016 01:36 PM |
| Cleaning unused files in Paperwhite | disu93 | Amazon Kindle | 2 | 09-14-2013 04:53 AM |
| delete unused style classess - no scroll bar | cybmole | Sigil | 5 | 11-08-2012 06:21 AM |