Skip to content

ZIP file support #9986

Closed
Closed
@clach04

Description

  • KOReader version: 2022.08
  • Device: Kindle PaperWhite 2

Issue

Documentation mentions ZIP file support but does not explain this in detail

It looks like any supported format can be supported in a ZIP file IF the filename of the zip file is *.FORMAT.zip, e.g.:

  • myfile.txt.zip
  • myfile.rtf.zip

However https://github.com/koreader/koreader/blob/master/frontend/document/credocument.lua#L155 indicates the file type can be inferred by the first filename in the archive (a feature supported by many softwre ebook readers like FBReader, AlReader, etc). This does not appear to work.

I think there are two issues at play here:

  1. ZIP support not working consistently
  2. Doc issue, assuming the above is correct I could post a PR to the readme for this repo (the inde, and also add a comment to User Guide Discussions - Up to 23.10 (PDF version) #8058) once this is confirmed.

As always thanks to everyone working to support KoReader!

Steps to reproduce

See attached test/demo documents (from https://github.com/clach04/sample_reading_media):

Both books contain a single file called test_book.txt, no other files inside the ZIP archive.

>"c:\Program Files\7-Zip"\7z l C:\tmp\test_book.txt.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 254 bytes (1 KiB)

Listing archive: C:\tmp\test_book.txt.zip

--
Path = C:\tmp\test_book.txt.zip
Type = zip
Physical Size = 254

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2020-09-29 15:47:45 ....A          209           94  test_book.txt
------------------- ----- ------------ ------------  ------------------------
2020-09-29 15:47:45                209           94  1 files

>"c:\Program Files\7-Zip"\7z l C:\tmp\test_book_txt.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 254 bytes (1 KiB)

Listing archive: C:\tmp\test_book_txt.zip

--
Path = C:\tmp\test_book_txt.zip
Type = zip
Physical Size = 254

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2020-09-29 15:47:45 ....A          209           94  test_book.txt
------------------- ----- ------------ ------------  ------------------------
2020-09-29 15:47:45                209           94  1 files
crash.log (if applicable)

No crash.log

Let me know if logging is needed

If your issue doesn't directly concern a Lua crash, we'll quite likely need you to reproduce the issue with verbose debug logging enabled before providing the logs to us.
To do so, from the file manager, go to [Tools] → More tools → Developer options, and tick both Enable debug logging and Enable verbose debug logging.
You'll need to restart KOReader after toggling these on.

If you instead opt to inline it, please do so behind a spoiler tag:

crash.log
<Paste crash.log content here>

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions