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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-10-2026, 03:59 AM   #1
byword
Member
byword began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2022
Device: Onyx Leaf 3
Issue with manifest items being declared multiple times.

It seems that manifest items are being duplicated when adding files using the newly added Drop Zone.

Steps to Reproduce:

1. Add a file via the Drop Zone.
2/ Add another file with the exact same name via the Drop Zone again.

When adding files this way, two manifest items are created: one using the filename ID and another using a random ID.

Example of duplicate manifest items generated by Sigil.

<item id="txt_69-2.png" href="Images/txt_69-2.png" media-type="image/png"/>
<item id="x9dbbd7d2-c149-4d38-9e87-21079c863550" href="Images/txt_69-2.png" media-type="image/png"/>

Note: For reference, I am using a custom build from the latest source code, which includes the fixes for the prettify issue and the CSS synchronization issue.

Last edited by byword; 07-10-2026 at 04:06 AM.
byword is offline   Reply With Quote
Old 07-10-2026, 04:33 AM   #2
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 993
Karma: 3600000
Join Date: Jan 2017
Location: Poland
Device: Various
I always wonder how to add another file with the same name, because I don't know how to do it.

There must be some other factors at play here that I'm not aware of.
Attached Thumbnails
Click image for larger version

Name:	sigil-the-same-name.png
Views:	26
Size:	6.3 KB
ID:	224343  
BeckyEbook is offline   Reply With Quote
Advert
Old 07-10-2026, 08:09 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,785
Karma: 7000000
Join Date: Nov 2009
Device: many
I think this may be a duplicate of this bug:

https://github.com/Sigil-Ebook/Sigil/issues/871

That should already be fixed in master. Please see if your build contains this fix:

https://github.com/Sigil-Ebook/Sigil...a39b4b805cce1b

Please note: DropZone uses the AddExisting code.

I will try adding the same png twice? It should ask you if you want to overwrite the existing image. Just like BeckyEbook's image shows. If not, it is a different bug.

Previously this bug happened by pulling in two different xhtml files that both linked to the same png image but the change linked to above was tested and fixed that.

Interestingly, I could never recreate this issue on MacOS, only Windows and Linux.

Last edited by KevinH; 07-10-2026 at 08:29 AM.
KevinH is offline   Reply With Quote
Old 07-10-2026, 09:01 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,579
Karma: 212299010
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm getting the same results as the OP on Windows with the latest commits and following the steps provided (including using a PNG).

I always get the dialog asking if I want to overwrite the existing file or not. If I click "No," nothing is added (that seems correct to me). If I click "Yes," the existing png file gets overwritten (different pngs; same name to test), but a duplicate entry is added to the manifest with a generated uuid as the item id.

EDIT: I never tested the original bugfix by adding files individually. That issue only arose when adding a bunch of files at once that had links to the same file. In fact, that bug could be worked around by adding the css first, then the images, and then the xhtml. Perhaps we just shifted the issue to individually added files somehow?

Last edited by DiapDealer; 07-10-2026 at 12:24 PM.
DiapDealer is offline   Reply With Quote
Old 07-10-2026, 09:13 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,785
Karma: 7000000
Join Date: Nov 2009
Device: many
Argh! There is a special case needsToUpdateOPF var to handle just that case. It has gotten broken with the fix.



Quote:
Originally Posted by DiapDealer View Post
I'm getting the same results as the OP on Windows with the latest commits and following steps provided (including using a PNG).

I always get the dialog asking if I want to overwrite the existing file or not. If I click "No," nothing is added (that seems correct to me). If I click "Yes," the existing png file gets overwritten (different pngs; same name to test), but a duplicate entry is added to the manifest with a generated uuid as the item id.

EDIT: I never tested the original bugfix by adding files individually. That issue only arose when adding a bunch of files at once that had links to the same file. In fact, that bug could be worked around by adding the css first, then the images, and then the xhtml. Perhaps we just shifted the issue to individually added files somehow?

Last edited by KevinH; 07-10-2026 at 09:20 AM.
KevinH is offline   Reply With Quote
Advert
Old 07-10-2026, 10:00 AM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,785
Karma: 7000000
Join Date: Nov 2009
Device: many
Okay, the whole idea behind needsToUpdateOPF was broken. I have reverted the code in AddExisting to do a full delete of the image resource with immediate updating of the opf before re-adding it with its replacement.

Correct and slower is much better than sometimes incorrect and faster.

We can revisit this in the future by directly writing the new image data to its underlying file with no changes at all to the OPF to re-speed things up. But I want stability now, not more changes that may be broken in some way. There are just too many code paths in that one routine and too many special cases to handle. It should probably be completely rewritten at some point. But right now it should be fully working.

I have pushed this fix to master. So if you build your own, please update it.
(DiapDealer I used deploy so you should be able to grab a build too).

Thank you for your bug report!
KevinH is offline   Reply With Quote
Old 07-10-2026, 10:37 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,579
Karma: 212299010
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes. That seems to have taken care of it. I can't find my folder full of 1000 images to see how much it slowed back down, but I agree that slower and stable beats fast and buggy every time.
DiapDealer is offline   Reply With Quote
Old 07-10-2026, 01:13 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 53,050
Karma: 181147351
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I build the update and, for me, it seems a bit slower with my test ePub but slower beats broken.
DNSB is online now   Reply With Quote
Old 07-10-2026, 04:54 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,785
Karma: 7000000
Join Date: Nov 2009
Device: many
The slowdown should be minor unless all 1000 images are actually being replaced! Only the replacement of an image would slow things down the way it is now.
KevinH is offline   Reply With Quote
Old 07-10-2026, 07:33 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 53,050
Karma: 181147351
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
The slowdown should be minor unless all 1000 images are actually being replaced! Only the replacement of an image would slow things down the way it is now.
Only 512 images but that is exactly what my test does. On my computer, I can tell that it is slower but not to the point that I'm being bothered by it.
DNSB is online now   Reply With Quote
Old 07-10-2026, 08:05 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,785
Karma: 7000000
Join Date: Nov 2009
Device: many
After our upcoming Sigil 2.8.1 release in a few weeks, I will try an alternative approach to handling replacements of images without needing to touch the opf at all, which should speed things up again. That code is just a bit too fragile to play with for a pure bug fix release.

Last edited by KevinH; Yesterday at 08:35 AM.
KevinH 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
Request: In TOC editing drag to select multiple items. graatch Calibre 3 01-14-2022 12:56 AM
manifest and spine issue larysa Editor 4 10-17-2021 12:07 PM
Multiple 'Not' searches fail to remove items ChrisMillward Calibre 7 07-04-2020 06:12 AM
Long text columns containg multiple items Rellwood Library Management 1 04-08-2019 05:12 PM
Display non-tagged items without having to click the tag icon two times duytrung Calibre 4 06-30-2017 10:26 AM


All times are GMT -4. The time now is 03:51 PM.


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