Magick.NET
Magick.NET copied to clipboard
AutoOrient does not work for Heic images
Magick.NET version
13.9.1
Environment (Operating system, version and so on)
Windows10, net framework 4.7.2
Description
AutoOrient() not work
Steps to Reproduce
Thanks for sharing the images but I have no idea what your issue is?
Thanks for sharing the images but I have no idea what your issue is?
AutoOrient(),The image should automatically rotate in the direction of the arrow, with the arrow pointing upwards
i test jpg , it work fine. but heic, it not work fine
i update sample image.(By the way, I'm not sure if 90.heic should be rotated 90 or 270 degrees, I don't understand the Heic image format)
Heic images should automatically be orientated to the right direction? You should not need to AutoOrient them. Please provide a small code sample that demonstrates your issue?
I don't quite understand the definition of the orientation tag in the heic image format.
90.heic as an example, the default rotation of this image is 270 degrees My understanding is that after using AutoOrient or not using AutoOrient, the image should be displayed in different directions. Either the arrow direction of the image after using AutoOrient is left, or the arrow direction of the image without AutoOrient is left. But the arrow direction should not be left in both cases.
Maybe there is something wrong with my understanding of AutoOrient?
Heic images are automatically "auto oriented" when they are being read.
This issue comes from here
How can I make the image show the correct orientation?
i try copytrans, The orientation of the images is correct
it is ImageGlass (Magick.Net 13.9.1), The orientation of the images is incorrect
i try Openize.HEIC, The orientation of the images is correct
i set PreserveOrientation = false, The orientation of the images is correct settings.SetDefines(new HeicReadDefines { PreserveOrientation = false, });
so, AutoOrient is invalid for heic ?
BaseWidth is always the same as Width ( PreserveOrientation = false or true ), I think there should be at least one case where BaseWidth should not be the same as Width, ( Openize.HEIC---- ispeWidth not same as Width )
BaseWidth and BaseHeight will return the original Width or Height that was read. The library that we are using to read heic files will automatically read the image in TopLeft orientation and has a special flag to disable this behavior (PreserveOrientation). And then you might need to use AutoOrient . But it is recommended to just let the heic coder decide this.
i test 90.heic set PreserveOrientation = false AutoOrient() does not work , MagickImage.Orientation is always TopLeft. if set PreserveOrientation = true, MagickImage.Orientation is Undefined, then AutoOrient(), MagickImage.Orientation is TopLeft.
So I cannot know if the direction of 90.heic is rotating 270 degrees
heic image will lost Original orientation information ?
I finally had some time to take a deeper look at what you were asking. The Orientation should not be Undefined when you set the PreserveOrientation option but it looks like we never implemented something in ImageMagick to read that information. I just pushed a patch to the ImageMagick repository to add support for this. You will get the correct orientation in the next release when you specify PreserveOrientation.