{"action":"created","issue":{"url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/354","repository_url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor","labels_url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/354/comments","events_url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/354/events","html_url":"https://github.com/JimBobSquarePants/ImageProcessor/issues/354","id":143226430,"number":354,"title":"ImageProcessor.Common.Exceptions.ImageProcessingException: Error processing image with Resize","user":{"login":"eNTi","id":431562,"avatar_url":"https://avatars.githubusercontent.com/u/431562?v=3","gravatar_id":"","url":"https://api.github.com/users/eNTi","html_url":"https://github.com/eNTi","followers_url":"https://api.github.com/users/eNTi/followers","following_url":"https://api.github.com/users/eNTi/following{/other_user}","gists_url":"https://api.github.com/users/eNTi/gists{/gist_id}","starred_url":"https://api.github.com/users/eNTi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eNTi/subscriptions","organizations_url":"https://api.github.com/users/eNTi/orgs","repos_url":"https://api.github.com/users/eNTi/repos","events_url":"https://api.github.com/users/eNTi/events{/privacy}","received_events_url":"https://api.github.com/users/eNTi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-24T11:54:04Z","updated_at":"2016-03-25T02:39:35Z","closed_at":null,"body":"i'm having trouble with the resize method on a REMOTE SERVER. this doesn't occur on my local machine (in debug mode). i basically get an exception which tells the file upload (fineuploader) that something went south. this doesn't happen with every picture though. i've yet to find a pattern as to when that occurs. it seem to occur more frequently with .png files but it will also happen (less often) with .jpg files. it doesn't seem to be overly related to the file size. sometimes smaller pictures fail while larger one's work.\r\n\r\n```\r\nImageProcessor.Common.Exceptions.ImageProcessingException: Error processing image with Resize \r\n---> ImageProcessor.Common.Exceptions.ImageProcessingException: Error processing image with Resizer \r\n---> System.ArgumentException: Ungültiger Parameter. bei\r\n System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) bei ImageProcessor.Imaging.Resizer.ResizeLinear(Image source, Int32 width, Int32 height, Rectangle destination) bei \r\nImageProcessor.Imaging.Resizer.ResizeImage(Image source, Int32 width, Int32 height, Int32 maxWidth, Int32 maxHeight, List`1 restrictedSizes, ResizeMode resizeMode, AnchorPosition anchorPosition, Boolean upscale, Single[] centerCoordinates, Boolean linear) \r\n--- Ende der internen Ausnahmestapelüberwachung \r\n--- bei ImageProcessor.Imaging.Resizer.ResizeImage(Image source, Int32 width, Int32 height, Int32 maxWidth, Int32 maxHeight, List`1 restrictedSizes, ResizeMode resizeMode, AnchorPosition anchorPosition, Boolean upscale, Single[] centerCoordinates, Boolean linear) bei\r\n ImageProcessor.Imaging.Resizer.ResizeImage(Image source, Boolean linear) bei\r\n ImageProcessor.Processors.Resize.ProcessImage(ImageFactory factory) \r\n--- Ende der internen Ausnahmestapelüberwachung\r\n--- bei ImageProcessor.Processors.Resize.ProcessImage(ImageFactory factory) bei\r\n ImageProcessor.Imaging.Formats.FormatBase.ApplyProcessor(Func`2 processor, ImageFactory factory) bei ImageProcessor.ImageFactory.Resize(ResizeLayer resizeLayer) bei ImageProcessor.ImageFactory.Resize(Size size) bei Nop.Services.Media.PictureService.Reformat(Byte[] fileBinary, Int32 dpi, Double height, Double width) in C:\\Projects\\nopCommerce\\src\\Libraries\\Nop.Services\\Media\\PictureService.cs:Zeile 881.\r\n```\r\n\r\nthe code where the issue occurs is:\r\n```\r\npublic byte[] Reformat(byte[] fileBinary, int dpi, double height, double width)\r\n{\r\n\tvar memoryStream = new MemoryStream();\r\n\tvar iFactory = new ImageFactory();\r\n\tvar size = new Size();\r\n\tvar i = iFactory.Load(fileBinary);\r\n\r\n\tif (i.Image.Width > i.Image.Height)\r\n\t{\r\n\t\tsize.Width = (int)Math.Ceiling(dpi * width);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsize.Height = (int)Math.Ceiling(dpi * height);\r\n\t}\r\n\r\n\ti.Resize(size).Resolution(dpi, dpi).Save(memoryStream); // Zeile 881\r\n\r\n\tvar newBinary = new byte[memoryStream.Length];\r\n\tmemoryStream.Read(newBinary, 0, newBinary.Length);\r\n\r\n\treturn newBinary;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/comments/201112978","html_url":"https://github.com/JimBobSquarePants/ImageProcessor/issues/354#issuecomment-201112978","issue_url":"https://api.github.com/repos/JimBobSquarePants/ImageProcessor/issues/354","id":201112978,"user":{"login":"JimBobSquarePants","id":385879,"avatar_url":"https://avatars.githubusercontent.com/u/385879?v=3","gravatar_id":"","url":"https://api.github.com/users/JimBobSquarePants","html_url":"https://github.com/JimBobSquarePants","followers_url":"https://api.github.com/users/JimBobSquarePants/followers","following_url":"https://api.github.com/users/JimBobSquarePants/following{/other_user}","gists_url":"https://api.github.com/users/JimBobSquarePants/gists{/gist_id}","starred_url":"https://api.github.com/users/JimBobSquarePants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimBobSquarePants/subscriptions","organizations_url":"https://api.github.com/users/JimBobSquarePants/orgs","repos_url":"https://api.github.com/users/JimBobSquarePants/repos","events_url":"https://api.github.com/users/JimBobSquarePants/events{/privacy}","received_events_url":"https://api.github.com/users/JimBobSquarePants/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T02:39:35Z","updated_at":"2016-03-25T02:39:35Z","body":"Hi there,\r\n\r\nWithout looking into any details you are most likely having problems since you are not disposing of any of the `IDiposable `objects within your method. Did you look at the example code?\r\n\r\nhttp://imageprocessor.org/imageprocessor/imagefactory/#methods\r\n"}}