r/jpegxl•
xeow

Simplest way to fetch dimensions of a JPEG XL image?

I was thinking that I could say djxl image.jxl - | head -2 | tail -1, but then I realized that it wasn't defaulting to PPM as an output format (instead failing and giving 0 bytes of output), and there doesn't seem to be a command-line switch to force djxl to output a PPM to standard output.

Could I alternatively just open the file and seek to some specific offset in the header and read the width and height of the image as 32-bit or 64-bit values?

Or, better yet, is there a tool that will simply print (to stdout) the width and height of a JPEG-XL image given its filename?

Posted Dec 5, 2021, 10:13 PM UTC

56
Loading comments…