-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(heic): Make auto-transform of camera-rotated images optional
Policy change about ImageInput automatic transformation of images with camera orientation data, as follows: * Some ImageInput format readers may have the capability to automatically reorient images to the preferred display orientation upon input, based on the camera Orientation metadata. Whether a reader does so will tend to depend on the capabilities of the underlying format library. If it can support reorientation easily, it is expected to do the reorientation automatically by default. * If the pixel data are re-oriented, the "Orientation" metadata should be set to 1 to indicate that the image returned to the caller is in the preferred display orientation) and "oiio:OriginalOrientation" metadata should be set to indicate the original camera orientation (prior to the automatic re-orientation). * Open-with-configuration hint "oiio:reorient" (default: 1), if set to 0, is a request to NOT do the reorientation. In that case, "Orientation" metadata should be set correctly to the actual orientation. The heif reader was previously always re-orientating images as the default behavior of the underlying libheif. That remains the default, but this patch makes the following changes to libheif behavior to conform to the policy above: (a) changes to code to allow it to disable the reorienting behavior if hint "oiio:reorient" is 0; (b) correct setting of Orientation and oiio:OriginalOrientation metadata; (c) make this more clean in the documentation. Tech details: The trick is that using the C++ API wrapper of libheif, there is no way to pass the decoder options struct that is where you need to say not to auto-transform. Needed to drop down to the lower level C API for this one spot. Fixes #4123 A subsequent PR will revisit the RAW reader to make it also conform to the new policy. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
10 changed files
with
591 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.