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

LoadImageInfo does not return correct values for width and height if image is from mobile phone and image is in portrait mode #470

Open
peter-tornqvist-kan opened this issue Jan 29, 2025 · 0 comments

Comments

@peter-tornqvist-kan
Copy link

As per the title, if I want to get width/height of an image in portrait mode from a mobile phone, the width and height are incorrect (width is wider that height).

I use this code to call the method:

using (var stream = imageBlob.OpenRead())
			{
				string[] info = new[] { "source.width", "source.height", "final.width", "final.height", "result.ext", "result.mime" };

				var length = stream.Length; // set length before calling LoadImageInfo
				var result = CurrentImageBuilder.LoadImageInfo(stream, info);
				return new Tuple<int, int, long>((int)result["source.width"], (int)result["source.height"], length);
			}

Is there some setting I am missing in the call to LoadImageInfo (i.e in info)?

I've found code here on github that seems to indicate that you do actually autorotate by default for some calls (in ImageBuilder.PostDecodeStream), but I am unsure if this code is > 4.2.8 or not called when calling LoadImageInfo.

We are currently on ImageBuilder 4.2.8

Thanks

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

1 participant