Skip to content

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

@peter-tornqvist-kan

Description

@peter-tornqvist-kan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions