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

JPEG XS Two mime types #52

Closed
NebularNerd opened this issue Feb 23, 2024 · 4 comments · Fixed by #56
Closed

JPEG XS Two mime types #52

NebularNerd opened this issue Feb 23, 2024 · 4 comments · Fixed by #56

Comments

@NebularNerd
Copy link
Contributor

I was having a look around the various JPEG X* flavours and came across https://en.wikipedia.org/wiki/JPEG_XS which is both a still image and video codec.

Just to be awkward they use the same fingerprint 0xFF10 FF50 for both image and video but then give it two mime types image/jxsc and video/jxsv.

What would be the best approach to handle this? Two entries in the .json one for each type? I'm not sure of other formats that would do this but I reckon they are out there.

@cdgriffith
Copy link
Owner

There might be more information inside the file itself, I sadly don't have an ISO memebership so can't check the full spec file.

I would personally default to just the image. As even most viewers for JPEG XL / AVIF / HEIF only support the still image aspect of them.

@NebularNerd
Copy link
Contributor Author

I'll try and find some test files and see if there is an additional fingerprint we could use. Hopefully there will be a nice little byte or two that gives away what inside. 🙂

@NebularNerd
Copy link
Contributor Author

NebularNerd commented Feb 26, 2024

Mmmm.... Looking at a .jxs image (after compiling the reference software) it seems the images at least have a fairly long fingerprint with a few changes depending on the profile used, then at byte 102 we get 0x49 53 4F 2D 32 31 31 32 32 2D 35 2D 32 2E 30 2E 32 2D 45 44 32 which is ISO-21122-5-2.0.2-ED2

I imagine that would possibly change as drafts are finalised and such, however, the ISO-21122 should remain fixed as it's the designation for the JPEG XS Standard.

EDIT: Get weirder, while .jxs is an image format, it's not the image format that matches the fingerprint.
https://www.loc.gov/preservation/digital/formats/fdd/fdd000545.shtml?loclr=blogsig

  • .jxs Image 0x0000 000C 4A58 5320 0D0A 870A
  • .jxsc Codestreams 0xFF10 FF50

@cdgriffith cdgriffith mentioned this issue Apr 26, 2024
cdgriffith added a commit that referenced this issue Apr 26, 2024
- Adding #52 magic data for JPEG XS (thanks to Andy - NebularNerd)
- Adding #57 Multi-part checks with negative offsets (thanks to Andy - NebularNerd)
- Fixing #60 encoding warning (thanks to Andy - NebularNerd and Jason R. Coombs)

---------

Co-authored-by: Andy <[email protected]>
@cdgriffith
Copy link
Owner

Added in 1.22 https://github.com/cdgriffith/puremagic/releases/tag/1.22

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.

2 participants