why does ImageResizer is rotating automaticlly image photographed vertical and show it horizontal

时光怂恿深爱的人放手 提交于 2019-12-12 02:57:07

问题


Hello i Have uploaded image using ImageResizer using this code var instructions = new ImageResizer.Instructions { Width = Convert.ToInt32(Newwidth), Height = Convert.ToInt32(Newheiht), Format = "jpg", Mode = ImageResizer.FitMode.Crop,
Scale = ImageResizer.ScaleMode.Both, };
File.InputStream.Seek(0, SeekOrigin.Begin); ImageResizer.ImageJob i = new ImageResizer.ImageJob(File, Filepath, instructions); i.CreateParentDirectory = false; i.Build();

i have tried using

AutoRotate = true

i still got the image rotated to horizontall

i also tried Rotate=90 the pic was rotated and lost the proportion here is how it looks like after rotate

the resized roteted picture changed it to width=296 height=437 instead of height=296 width=437

the image was taken vertically using samsung galaxy 3 buy when resized it and upload it it show horizonally

here is the original photo taken:

here is how it shown after uploaded:


回答1:


You haven't posted the diagnostics page, which lists which plugins are installed.

The most likely cause is that you didn't <add name="AutoRotate" /> or new AutoRotate().Install(Config.Current) to install the AutoRotate plugin, and therefore &autorotate=true had no effect.

It's also possible that there's a new form of image metadata that we can't detect yet, but that seems less likely.




回答2:


Try Autorotate property "True"; It worked for me.

&autorotate=true


来源:https://stackoverflow.com/questions/29983705/why-does-imageresizer-is-rotating-automaticlly-image-photographed-vertical-and-s

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!