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

Documentation of supported output file extensions and their effects doesn't reflect encoder behaviour #150

Closed
bitsgalore opened this issue Oct 24, 2023 · 2 comments

Comments

@bitsgalore
Copy link

bitsgalore commented Oct 24, 2023

Both the project readme and open_htj2k_enc's helper text provide conflicting and partially inaccurate information on recognized file extensions for the output file, and their effect on the resulting file formats.

The readme says this (under Supported file types):

output codestreams: .j2k, .j2c, .jphc (Part 15 codestream), .jph (Part 15 file format)

Whereas open_htj2k_enc's helper text says something different:

-o: Output codestream
.jhc or .j2c are recommended as the extension.

I tried out all listed extensions, and ended up with this:

  • Extension .jphc results in a JPH file, not a codestream
  • Extension .jhc is not recognized at all, and results in "ERROR: invalid extension for output file"
  • Extensions .j2c and j2k both result in a raw codestream (as expected)
  • Extension .jph results in a JPH file (as expected)

Adding to the confusion here is the use of "output codestream" (both in the readme and the helper text), since this option really defines an output file. This file can either be a Part 15 codestream, or a JPH file (in which case it isn't a codestream!).

Looking at E.2.2 and E.3.2 (Registration) in ISO/IEC 15444-15:2019 (E), this lists .jph as the registered extension for JPH files, and .jhc as the registered extension for codestreams. It doesn't mention a .jphc extension, although jphc is listed as a subtype name for codestreams.

My suggestion would be to change the description of the -o option to "output file" (both in the readme and the helper text), and stick to these conventions for the output extensions:

  • .jph extension triggers JPH file creation
  • .jhc extension triggers HT codestream creation (optionally with .j2c and/or .j2k as aliases)
  • drop the .jphc extension altogether (since it's not meant to be used as a file extension)
@bitsgalore bitsgalore changed the title Documentation of supported output file extensions and their effects doesn't reflect enoder behaviour Documentation of supported output file extensions and their effects doesn't reflect encoder behaviour Oct 24, 2023
@osamu620
Copy link
Owner

@bitsgalore You are right. At the time of development of this library, HTJ2K-related extensions were not fixed. Now we have stable names of extensions, it absolutely makes sense to adopt your suggestion. I will fix this up soon.

@osamu620
Copy link
Owner

This issue has been fixed by #152

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

No branches or pull requests

2 participants