{"action":"created","issue":{"url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/14","labels_url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/14/comments","events_url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/14/events","html_url":"https://github.com/ProfessorFarnsworth/HTML-5-File-Upload/issues/14","id":56817485,"number":14,"title":"Black border/background on images","user":{"login":"bjarnef","id":2919859,"avatar_url":"https://avatars.githubusercontent.com/u/2919859?v=3","gravatar_id":"","url":"https://api.github.com/users/bjarnef","html_url":"https://github.com/bjarnef","followers_url":"https://api.github.com/users/bjarnef/followers","following_url":"https://api.github.com/users/bjarnef/following{/other_user}","gists_url":"https://api.github.com/users/bjarnef/gists{/gist_id}","starred_url":"https://api.github.com/users/bjarnef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjarnef/subscriptions","organizations_url":"https://api.github.com/users/bjarnef/orgs","repos_url":"https://api.github.com/users/bjarnef/repos","events_url":"https://api.github.com/users/bjarnef/events{/privacy}","received_events_url":"https://api.github.com/users/bjarnef/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-02-06T14:26:19Z","updated_at":"2015-02-07T18:48:41Z","closed_at":null,"body":"I noticed there is a black border or background on images. Is it using ImageProcessor to scale the images? I think I have seem it before.\r\n\r\nI think it is because of wrong calculated image size. The original image size of the one hightlighted is 5412 x 6843 ( w x h).. using http://andrew.hedges.name/experiments/aspect_ratio/ and set W2 to 94px (as the scaled image) it tells me the H2 (resized height) should be 119px, but in this view it is 120px, which probably is the reason of the black border at the bottom.\r\nThe the view in core of Umbraco the image is scaled correct according to aspect ratio.\r\n\r\n![2015-02-06_15-15-05](https://cloud.githubusercontent.com/assets/2919859/6080645/6de64adc-ae13-11e4-96ab-bc098e565659.jpg)\r\n\r\n![2015-02-06_15-15-16](https://cloud.githubusercontent.com/assets/2919859/6080648/7298dc34-ae13-11e4-9a27-35c267052bd8.jpg)\r\n\r\n![2015-02-06_15-26-45](https://cloud.githubusercontent.com/assets/2919859/6080807/b68ac82a-ae14-11e4-85e8-b0a9fa4aa293.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/comments/73377151","html_url":"https://github.com/ProfessorFarnsworth/HTML-5-File-Upload/issues/14#issuecomment-73377151","issue_url":"https://api.github.com/repos/ProfessorFarnsworth/HTML-5-File-Upload/issues/14","id":73377151,"user":{"login":"ProfessorFarnsworth","id":10512874,"avatar_url":"https://avatars.githubusercontent.com/u/10512874?v=3","gravatar_id":"","url":"https://api.github.com/users/ProfessorFarnsworth","html_url":"https://github.com/ProfessorFarnsworth","followers_url":"https://api.github.com/users/ProfessorFarnsworth/followers","following_url":"https://api.github.com/users/ProfessorFarnsworth/following{/other_user}","gists_url":"https://api.github.com/users/ProfessorFarnsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ProfessorFarnsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProfessorFarnsworth/subscriptions","organizations_url":"https://api.github.com/users/ProfessorFarnsworth/orgs","repos_url":"https://api.github.com/users/ProfessorFarnsworth/repos","events_url":"https://api.github.com/users/ProfessorFarnsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ProfessorFarnsworth/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T18:48:41Z","updated_at":"2015-02-07T18:48:41Z","body":"FINALLY :D I found the issue. Thanks to your files (Only happens with them).\r\nThe downside though is that I can't do really much about it. Something in the GDI+ (also used by Umbraco) causes this issue.\r\n\r\nThis line is the troublemaker:\r\nServices.MediaService.Save(media, int.Parse(userId), true);\r\n\r\nIf I change the boolean at the end to false it works.\r\nServices.MediaService.Save(media, int.Parse(userId), false);\r\n\r\nBUT ... If I keep it at false and try to upload mutliple files at once... bam all uploaded images are detected as Files caused by my GDI+ method to detect if it is an image or not tells me that the uploaded file is not a image. (See function IsImage(...))\r\nSo sad to say something in the IIS Express is probably messing around with the memory and mixing the bits and bytes. Sounds weird? For me as well but the only explanation I do have atm. Maybe it is a bug in the IIS Express with multiple threads or so.\r\n\r\nMy solution would be to upload every image one by one. Which would slow down the upload process overall but I could guarantee that all images are uploaded and associated correctly.\r\n\r\nSo I think I'm going to implement that workaround.\r\n\r\nHopefully my description makes sense to you ;) Otherwise I gonna try to explain a bit more detailed.\r\nOr you just ask what where you would need more information about.\r\n\r\nBest Regards,\r\nHelmuth"}}