Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add a "-%n" to the filename of duplicated medias if the epub has them across all folders #22

Open
Palloxin opened this issue Oct 27, 2024 · 4 comments

Comments

@Palloxin
Copy link

Palloxin commented Oct 27, 2024

Lets say
image

In this epub there are 20 or so files with the same exact name, but in different folders. This might create some conflict or import problems on other epub readers, maybe also other programs.

Would be possible to add a -%n to the duplicated files name?
For example
1/OEBPS/Images/Cover.jpg => Cover-0.jpg
10/OEBPS/Images/Cover.jpg => Cover-9.jpg

Other details

image

here the file path is not so specific, so some programs might have problems since the merged epubs had the same file path.

Of course also the src links shuld be changed too, accordingly.

@Palloxin Palloxin changed the title [Feature request] Add a "-%n" to the filename of medias if the epub has duplicated names [Feature request] Add a "-%n" to the filename of duplicated medias if the epub has them across all folders Oct 27, 2024
@JimmXinu
Copy link
Owner

This absolutely does cause issues with some programs that don't pay attention to file paths. Not just with images, either. We saw it for years in Sigil, for example--now fixed as far as I know.

It came up again recently in #20 for stylesheets where I said:

EpubMerge doesn't actually parse or change the contents of the (x)html or style sheet files from merged books--it just puts them each in a subdirectory inside the zip file.

I'm reluctant to add that much additional processing to address what is essentially a bug in another program...

And since you're asking about a 'might' and not a specific 'program XYZ doesn't handle this correctly', I'm honestly even more reluctant.

As a work around, Calibre's Convert and Edit book tools both have options that can rewrite the epub to have all unique file names; albeit with the downside of losing EpubMerge's 'UnMerge' capability unless you save the pre-convert/edit epub.

@Palloxin
Copy link
Author

Palloxin commented Oct 28, 2024

Understood, would be possible to merge that calibre functionality into the plugin? idk (ignornatly), calling the feature and trasporting it in the plugin UX interface.

Since these problems are so frequent.. even with the mighty Moonreader like in that issue.

@JimmXinu
Copy link
Owner

I wouldn't say it's frequent. It's come up like 3-4 times I can remember in 12 years. And I remember because it is so baffling to me this is an issue.

Zip files containing dir paths goes back to pkzip 30+ years ago; and html links allowing for relative paths about the same. Which is the case in your screenshot above--there's no ambiguity unless the program is ignoring dir paths.

So I'll ask directly, what programs are you having problems with?

@Palloxin
Copy link
Author

Palloxin commented Oct 28, 2024

Lithium
ReadEra
LNReader, import feature (the nearest tachi-like for novels app avaiable on the internet)

i didnt dig deeply for other apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants