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

Wrong MIME types for comic book formats #23

Open
rluetzner opened this issue Feb 14, 2024 · 2 comments
Open

Wrong MIME types for comic book formats #23

rluetzner opened this issue Feb 14, 2024 · 2 comments

Comments

@rluetzner
Copy link

Independent of the file extensions, this library always returns application/x-cbr. This is incorrect, as there are specific MIME types for all the extensions, e.g. application/x-cbz or application/x-cb7.

To understand the impact, see the following issues in the Jellyfin project:

.

Here's a tl;dr: cbr (a.k.a. Rar) is a proprietary compression algorithm, so most FOSS eReaders will not accept it. 🙂

@rluetzner
Copy link
Author

Definitely something I can send a pull request for. 🙂

@rluetzner
Copy link
Author

I just learned that application/x-cbr is deprecated. According to IANA, it should be

application/vnd.comicbook-rar and
application/vnd.comicbook+zip.

rluetzner added a commit to rluetzner/MimeTypes that referenced this issue Feb 14, 2024
cb7, cba, cbr, cbt and cbz all refer to different types of digital
comicbooks. The last letter of the extension indicates the compression
algorithm that was used: 7zip, arc, rar, tar or zip.

All these filetypes used to have the `application/x-cbr` MIME type
assigned to them. However, that has since been deprecated and was
replaced with

- `application/vnd.comicbook-rar` for rar compressed files and
- `application/vnd.comicbook+zip` for rar compressed files.

Only these two are officially listed by IANA

https://www.iana.org/assignments/media-types/application/vnd.comicbook+zip

. cbr and cbz are by far the most common file extensions for comicbooks.

There's no official MIME type for cb7, cba or cbt files. However, with
rar being a proprietary compression algorithm, FOSS applications will
often refuse to handle files that identify themselves as
`application/x-cbr`, so I decided to assign extension specific MIME
types to them. I've seen these being used by other applications,
specifically comic book readers.

I've read through the docs on iana.org, but haven't figured out why they
chose `-rar`, but `+zip`.

This fixes khellang#23.
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

Successfully merging a pull request may close this issue.

1 participant