benchen71 / epub-metadata-editor

Edit the metadata of EPUB files
192 stars 11 forks source link

batch editing breaks images in epub #69

Closed TheCrappyCompletionist closed 2 years ago

TheCrappyCompletionist commented 2 years ago

Alright, here is the rundown.

I've tried checking the OPF file but can't seem to find any difference in the formatting that could hinder images from loading. I've added the links to the batch of epubs that I tried editing as a file share link on google drive. (book 6 won't corrupt. book 7 and 8 will corrupt if put in a batch edit of 2 epubs or more.) https://drive.google.com/file/d/1-64iMGsDZEGY1oaPd_8GCNvLv_QwvRYf/view?usp=sharing https://drive.google.com/file/d/1-6ghujezFvJvSRBcyA4WhRp1xABUmi02/view?usp=sharing https://drive.google.com/file/d/1-CiHW7m3jBlaRfgU9APCEmogK86wHZmE/view?usp=sharing

If there is any suspicions or things I could test, please let me know. i have no idea how to test because I have no idea what happens due to the lack of any consistency or reasoning.

benchen71 commented 2 years ago

I could see nothing obvious from my initial test run. The only thing I could see from a before/after comparison was that the id is being stripped from the title tag. But that shouldn't affect images.

When you say images fail to load, are you referring to the cover image?

TheCrappyCompletionist commented 2 years ago

not just the cover image, no. All images in the whole document get replaced with a white square placeholder.

benchen71 commented 2 years ago

OK, I have absolutely no idea why your reader can't view images properly. I don't think anything significant has been changed at all. However, I have taken the opportunity to update the code to better handle title file-as information. Here's a pre-release 1.9.1. Give it a try and see what happens. EPubMetadataEditor I was testing the output of batch edited files and they were displaying correctly in Calibre's ereader.

TheCrappyCompletionist commented 2 years ago

I'm just as confused as you are. The editor doesn't touch anything but the metadata, so how will the images be affected? I did a comparison with my file backups, and the original works fine but after editing the metadata of the files they show up blank. Here's a screenshot of the books: screenshot

12345

benchen71 commented 2 years ago

Try loading the bad ones into Calibre, do a save, and then try them in your reader. It will be interesting to see if Calibre can fix them. I can then take a look at the three OPF files: original, after EPUBMetadataEditor, and after Calibre.

TheCrappyCompletionist commented 2 years ago

calibre is able to fix it. Here are the files: (7 and 8 are broken, 9 is working fine) [edited to remove links] I dislike using calibre though because no matter what I try, the sorting order gets thrown out completely. Even just saving an already edited file makes the sorting of books go out of whack.

(edit: you don't have to worry about removing the links, only you have access to the files :) I ain't gonna give my copies away to some sneaky boi)

benchen71 commented 2 years ago

I will get back to this at some stage, but I'm back at work now, so it might be a while. Sorry!

benchen71 commented 2 years ago

Actually, if you can provide me with three versions of the same file, that would be super helpful: 1. original; 2. after EPUBMetadataEditor has broken the images; and 3. after Calibre has fixed it. Thanks.

TheCrappyCompletionist commented 2 years ago

Actually, if you can provide me with three versions of the same file, that would be super helpful: 1. original; 2. after EPUBMetadataEditor has broken the images; and 3. after Calibre has fixed it. Thanks.

that's what I've done with the 3 links above. They're Zip files, each containing a copy of volume 7, 8 and 9. the first link has the 3 before editing, the second link has the 3 after editing with the editor, and the third link has all 3 volumes after calibre has fixed it. sorry for my bad wording.

benchen71 commented 2 years ago

Brilliant! Thanks for doing that. That makes me far more keen to take a look and get to the bottom of this bug!

benchen71 commented 2 years ago

That did not exactly clear it up for me. I've tried something, but I have no idea if this will do the trick or not. Here's a pre-release 1.9.1 for you to try: EPubMetadataEditor

TheCrappyCompletionist commented 2 years ago

sorry for the late response - work has been taking any free time I had this week. There seems to be no change with the new version. The images just don't load. I wish there were more I could say, but I can't seem to find any kind of consistency or reason for this happening.

benchen71 commented 2 years ago

At this point I'm going to close this issue. Because the problem is only occurring with opening EPUBs in one specific viewer, there isn't really anything I can do. I don't know if the issue is with my program or with the viewer not handling something it should.