imazen / resizer

The official repository for ImageResizer
http://imageresizing.net/
Other
566 stars 172 forks source link

images with EXIF get rotated after processing #451

Closed kjyotiram closed 5 months ago

kjyotiram commented 1 year ago

Images are getting rotated 90 degrees based on the EXIF data of the images, but i need the images to be processed as they are uploaded. Here is the snippet below that i am using: var instructions = new Instructions { Width = maxWidth, Height = maxHeight, Format = "jpg", AutoRotate=false, SourceRotate=0, SourceFlip=0 };

        ImageBuilder.Current.Build(byteImageIn, outStream, instructions);
        resized = outStream.ToArray();

i am using ImageResizer V4 so the autorotate is built in, so how do i process the images without getting rotated once uploaded?

I tried removing the exif data even so the images are getting rotated after processing. Any idea on this, is it due to the Height and width differences.

lilith commented 1 year ago

Setting autorotate to false should absolutely be preventing exif from causing rotation. However, you are saying that it happens even without exif data. Can you upload the before and after images and your resizer.debug (just the plugins and config)?

kjyotiram commented 1 year ago

The images which we take in Potrait mode by rotating the phone are the one getting rotated. I tried processing after removing the EXIF data by converting image into BitMap Image, that didn't work as well

lilith commented 1 year ago

I need the image to analyze.

On Fri, Nov 18, 2022, 2:48 AM RAM KJR @.***> wrote:

The images which we take in Potrait mode by rotating the phone are the one getting rotated. I tried processing after removing the EXIF data by converting image into BitMap Image, that didn't work as well

— Reply to this email directly, view it on GitHub https://github.com/imazen/resizer/issues/451#issuecomment-1319771066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LHZT3AADXQT73Z4SLRTWI5GHZANCNFSM6AAAAAARIW4UAQ . You are receiving this because you commented.Message ID: @.***>

kjyotiram commented 1 year ago

PFA images, even when i mark AutoRotate false still the image gets rotated and stored. sample images.zip

lilith commented 1 year ago

Github reencodes all images, please email them to lilith@imazen.io

kjyotiram commented 1 year ago

I have attached in the ZIP folder, please check and getting the email address like this: @.***

lilith commented 1 year ago

Sorry, github redacted my email

lilith commented 1 year ago

I don't have enough information to help. If the images you e-mailed were before and after images, I don't think you're using ImageResizer - however, I would need your /resizer.debug page. https://imageresizing.net/docs/v4/geterror

If you're not using it on the web, call ImageResizer.Configuration.Config.Current.WriteDiagnosticsTo(string path)

kjyotiram commented 1 year ago

No, those are not before after images. They are two different images one taken rotated in portrait mode and one in normal portrait mode. Can you please try processing those two and check if you able to apply AutoRotate-False for those scenarios

lilith commented 1 year ago

I need the diagnostics page to attempt to reproduce this.

lilith commented 1 year ago

Can you provide the diagnostics page?