{"action":"created","issue":{"url":"https://api.github.com/repos/imazen/lightresize/issues/2","labels_url":"https://api.github.com/repos/imazen/lightresize/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/imazen/lightresize/issues/2/comments","events_url":"https://api.github.com/repos/imazen/lightresize/issues/2/events","html_url":"https://github.com/imazen/lightresize/issues/2","id":69173703,"number":2,"title":"`JobOptions.LeaveSourceStreamOpen` has no effect.","user":{"login":"stakx","id":104481,"avatar_url":"https://avatars.githubusercontent.com/u/104481?v=3","gravatar_id":"","url":"https://api.github.com/users/stakx","html_url":"https://github.com/stakx","followers_url":"https://api.github.com/users/stakx/followers","following_url":"https://api.github.com/users/stakx/following{/other_user}","gists_url":"https://api.github.com/users/stakx/gists{/gist_id}","starred_url":"https://api.github.com/users/stakx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stakx/subscriptions","organizations_url":"https://api.github.com/users/stakx/orgs","repos_url":"https://api.github.com/users/stakx/repos","events_url":"https://api.github.com/users/stakx/events{/privacy}","received_events_url":"https://api.github.com/users/stakx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-17T16:40:50Z","updated_at":"2015-04-18T13:38:40Z","closed_at":"2015-04-18T13:38:40Z","body":"`JobOptions.LeaveSourceStreamOpen` does not do what it promises. Even when this option is passed to the `ResizeJob.Build` method, the source stream will be disposed. The following (abbreviated) program demonstrates this:\r\n\r\n```csharp\r\n// using Imazen.LightResize;\r\n// using System.Diagnostics;\r\n// using System.Drawing;\r\n// using System.Drawing.Imaging;\r\n// using System.IO;\r\n\r\nusing (var sourceStream = new MemoryStream())\r\n{\r\n    using (var bitmap = new Bitmap(10, 10))\r\n    {\r\n        bitmap.Save(sourceStream, ImageFormat.Png);\r\n    }\r\n    var resize = new ResizeJob { Width = 5, Height = 5 };\r\n    var targetStream = new MemoryStream();\r\n    Debug.Assert(sourceStream.CanSeek && sourceStream.CanRead); // this is fine.\r\n    resize.Build(sourceStream, targetStream, JobOptions.LeaveSourceStreamOpen);\r\n    Debug.Assert(sourceStream.CanSeek && sourceStream.CanRead); // this fails!\r\n}\r\n```\r\n\r\nThe first assertion (immediately preceding the call to `ResizeJob.Build`) will succeed. The exact same assertion after the resize fails; it should not."},"comment":{"url":"https://api.github.com/repos/imazen/lightresize/issues/comments/94165419","html_url":"https://github.com/imazen/lightresize/issues/2#issuecomment-94165419","issue_url":"https://api.github.com/repos/imazen/lightresize/issues/2","id":94165419,"user":{"login":"nathanaeljones","id":107935,"avatar_url":"https://avatars.githubusercontent.com/u/107935?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanaeljones","html_url":"https://github.com/nathanaeljones","followers_url":"https://api.github.com/users/nathanaeljones/followers","following_url":"https://api.github.com/users/nathanaeljones/following{/other_user}","gists_url":"https://api.github.com/users/nathanaeljones/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanaeljones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanaeljones/subscriptions","organizations_url":"https://api.github.com/users/nathanaeljones/orgs","repos_url":"https://api.github.com/users/nathanaeljones/repos","events_url":"https://api.github.com/users/nathanaeljones/events{/privacy}","received_events_url":"https://api.github.com/users/nathanaeljones/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T13:38:40Z","updated_at":"2015-04-18T13:38:40Z","body":"Thanks for the fix!"}}