12

Whenever I have an EPUB file and open/read it using Calibre, Calibre silently edits the EPUB file. I know that Calibre edited my EPUBs because I calculated the checksums (SHA-256, MD5, etc.) before and after reading. This is surprising, improper, and undesirable behavior. I didn't ask Calibre to modify my books without my permission. An EPUB reader is supposed to read EPUB files, and not edit them. How do I stop Calibre from silently editing my EPUB files when I read them? The checksums before and after reading must remain the same.

2
  • 1
    I know that Calibre modifies the epub to add bookmarks. If you turn that off in the Preferences under Miscellaneous, do you still get a modified epub?
    – beaker
    Commented Sep 5, 2020 at 22:52
  • If you are on Linux and are not tied to Calibre, you can use zathura for ebooks (and PDFs). It also opens ebooks faster than Calibre. Here are some more alternatives to Calibre, all open source. Commented Aug 14, 2021 at 12:27

1 Answer 1

12

I hadn't looked before so I did a little investigating. With Calibre 4.23 on Linux, I found that it's not exactly Calibre, it's the Reader.

I don't know why this Reader (it's a newly re-written reader, but I don't know if the old one did this) is modifying the epub meta-data. There is no reason to do so that I'm aware of as bookmarks and other reading information is kept in the database.

With that in mind, I changed the EPUB file permission to remove write permission. As a Read-Only file, everything seems to continue working normally and the Reader is no longer capable of changing it.

So at this point I can only suggest:

  • Change all the epubs to read-only
  • Substitute a different reader
  • Send feedback to Calibre

additional info

I did a little more investigation and found that "ebook-viewer" is writing meta-data under "Miscellaneous" "calibre_bookmarks.txt" even though bookmarks are controlled via the database. Deleting this entire entry via "edit book" has no effect and the book marks are still present because they are in the DB.

The content written also includes: access time stamps, Book Title, and my User ID. It's written as JSON Base64.

This should not be happening!

I posted Bug #1894442

Calibre Response

Calibre says it's not a bug because most users prefer it this way. Nevertheless, it can be turned off by:

LTrun {sic} it off under the miscellaneous section of the viewer preferences.

  1. Open the Calibre viewer
  2. Right-click the body of the book to bring up the controls
  3. Select Preferences
  4. Select Miscellaneous
  5. Uncheck "Keep a copy of annotations/bookmarks in the e-book file, for easy sharing"

I verified that it worked (at least for one in a row).

Update

Apparently the checkbox to disable directly annotating the ebook file was removed in recent updates. I don't know why they are working so hard to force a hidden write function into a READER. However only the GUI presentation was removed, the actual option still exists, at least as of the current 6.19.1.

In the file .config/calibre/viewer-webengine.json an entry of:

"old_prefs_migrated": true,

       yada yada ...


 "standalone_misc_settings": {
      "save_annotations_in_ebook": false
    },

will still disable directly annotating the ebook file. If the entry is missing, Calibre defaults to true.

5
  • 1
    Thank you so much!
    – Berny23
    Commented Sep 26, 2021 at 12:11
  • This answer outdated as of 2023, the option under Miscellaneous has been removed. Commented Jun 5, 2023 at 14:38
  • @ user1461607 - Thank you for pointing this out, I updated my answer accordingly. Commented Jun 6, 2023 at 16:42
  • In the Edit Book Calibre, there's also an option in the preferences "Integration with Calibre" which says: Update metadata embedded in the book when opening. This could also modify the file!
    – Shayan
    Commented Jul 30, 2023 at 8:54
  • The checkbox is back and works fine in the current version 6.28.1.
    – Stein
    Commented Oct 8, 2023 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.