c# - How to auto-rotate an uploaded image -
i have site i'm allowing users upload photos. these files uploaded webapi endpoint httppostedfile
. after performing validation on uploaded file, stream:
var stream = httppostedfile.inputstream;
and resize:
var instructions= new instructions { width = 80, height = 80, outputformat = outputformat.jpeg, mode = fitmode.crop, autorotate = true }; var smallresizedimage = new memorystream(); var imagejob = new imagejob(stream, smallresizedimage, instructions); imagejob.build();
notice how in instructions, specify image should rotated. image not rotated, resized correctly.
i've tried setting key, same results:
instructions.add("autorotate", "true");
i using imageresizer version 3.4.3 without plugins or changes configuration settings.
based on previous comment nathanael jones, not copying stream bitmap or image, don't think exif information being removed.
Comments
Post a Comment