imagesize
imagesize copied to clipboard
Pixel aspect support?
It would be great if the crate also returned a num-rational::Ratio pixel_aspect for image formats that support this.
This would just be 1:1 for any image format that doesn't, or if absent.
I'm not entirely opposed to potentially getting this info, but I want to try to not rely on any external creates, sans dev dependencies.
Is there a flow that would require this information? How would you anticipate it fitting into the current library? Curious about how you'd want it to work.
When you want to call an external tool to resize an image, e.g. for a preview, it is often preferable to make sure the latter has a pixel aspect of 1:1.
Particularly OpenEXRs that were converted from CinemaDNGs shot with anamorphic lenses will often have 1:1.33 or 1:2 pixel aspects and need non-linear scaling to display correctly.
How would you want it integrated into the library? My first thought would be a pixel_size method that returns a new struct called PixelSize which seems simple enough.
Also if you happen to know which file types support different pixel sizes please let me know.
Yes, that sounds good. But it would be pixel_aspect which is short for pixel aspect ratio which is what literature and industry have settled on, as a term for this, since decades.
I also suggest to put this behind a feature flag. 😁