Sigil-Ebook / Sigil

Sigil is a multi-platform EPUB ebook editor
GNU General Public License v3.0
5.97k stars 578 forks source link

[Bug]: Impossible to edit Multiple content.opf #780

Closed Palloxin closed 3 weeks ago

Palloxin commented 3 weeks ago

Bug Description

image The epub comes from an epub merge made with calibre plugin.

  1. I cant edit them, dunno why, even if they are useful
  2. The epub has an error message about the content of these content.opf files, but i cant edit them. this is the error: image2 (i know the error is about the files i menzioned because i already fixed the problem on the only content.opf i could edit, PLUS upon deleting them the error is not triggered anymore)

Platform (OS)

Windows (Default)

OS Version / Specifics

windows 10

What version of Sigil are you using?

2.3.1

Any backtraces or crash reports

No response

kevinhendricks commented 3 weeks ago

Closing this. Your epub is not valid and the media types in the opf are wrong. Sigil is an epub editor. It loads and edits epubs, not broken things. It tries but can not always make sense of things when given garbage input.

Simply unzip your "broken epub" and make sure it has only one opf and that the opf contains valid media types. It is the OPF that determines the exact structure of the epub and how it is read in. Then use Sigil's FolderIn plugin to read in the "workable" version.

Palloxin commented 3 weeks ago

I am not complaining about the error, but at the fact i cant edit the excessive opf files. Let us edit them. Why should sigil block it.

dougmassay commented 3 weeks ago

Not possible. Sigil relies upon one properly-formatted opf file to function correctly.

kevinhendricks commented 3 weeks ago

And as I said, Sigil is an epub editor, and what you tried to load is NOT an epub.

Like any other zip archive, unzip it and fix it.

Palloxin commented 3 weeks ago

I cant fantom why it is not possible. I just want to access them instead of unzipping. Not sure what u mean with "it's not an epub", other epub readers can read it perfectly fine

dougmassay commented 3 weeks ago

If you cannot fathom it. There's no reason for us to try and explain it further. We're done here.

On Mon, Oct 28, 2024, 8:51 AM Palloxin @.***> wrote:

I cant fantom why it is not possible. I just want to access them instead of unzipping. Not sure what u mean with "it's not an epub", other epub readers can read it perfectly fine

— Reply to this email directly, view it on GitHub https://github.com/Sigil-Ebook/Sigil/issues/780#issuecomment-2441503914, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG3CXX32KUY4AVBN7QSFWTZ5YQMPAVCNFSM6AAAAABQXHMXHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBRGUYDGOJRGQ . You are receiving this because you commented.Message ID: @.***>

Palloxin commented 3 weeks ago

I was just trying to get a more clear explaination, i am not an expert. It's fine if u don't want; no need to be rude tho.

kevinhendricks commented 3 weeks ago

No one was rude. You pushed and refused to understand what we were saying. Sigil is not a file editor. It edits epubs and epubs have their own internal structures defined by the epub spec and opf that is pointed to by the container.xml inside META-INF folder.

If the OPF is not set property, the links and relationships among files is broken, the primary language is missing, the book id, the metadata etc all depend on that. That is how Sigil knows what files to update when things are renamed, or moved or ... The opf supplies the manifest of all included files and the spine order.

Sigil was designed to not delete any OPF as it is required, not optional. And only one opf, not many especially not with with made up media types!

We explained how to "fix" this by unzipping the "garbage" you supplied and making it meet the absolute minimum for something recognizable as an epub. But that was not possible as you did not want to "unzip" it! Huh! An epub is a zip container with a specific structure inside. You have to unzip it to work with any of those files.