diff --git a/Greenshot/releases/additional_files/readme.txt b/Greenshot/releases/additional_files/readme.txt index 4de1d7f3c..8b553ba5b 100644 --- a/Greenshot/releases/additional_files/readme.txt +++ b/Greenshot/releases/additional_files/readme.txt @@ -4,7 +4,7 @@ Greenshot: A screenshot tool optimized for productivity. Save a screenshot or a CHANGE LOG: We changed the version to 1.0 after 5 years it should no longer have a "beta" feeling! -1.0.4 build 2176 Release Candidate 4 +1.0.4 build 2177 Release Candidate 4 Bugs resolved: * Fixed error during OAuth process due to authorization dialog not opening, see bug #3578480 diff --git a/GreenshotImgurPlugin/ImgurUtils.cs b/GreenshotImgurPlugin/ImgurUtils.cs index 306fb96a4..06b6eedf9 100644 --- a/GreenshotImgurPlugin/ImgurUtils.cs +++ b/GreenshotImgurPlugin/ImgurUtils.cs @@ -112,22 +112,26 @@ namespace GreenshotImgurPlugin { } string responseString = null; if (config.AnonymousAccess) { - // add key - uploadParameters.Add("key", IMGUR_ANONYMOUS_API_KEY); - HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest(config.ImgurApiUrl + "/upload.xml?" + NetworkHelper.GenerateQueryParameters(uploadParameters) + NetworkHelper.GenerateQueryParameters(otherParameters)); + // add key, we only use the other parameters for the AnonymousAccess + otherParameters.Add("key", IMGUR_ANONYMOUS_API_KEY); + HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest(config.ImgurApiUrl + "/upload.xml?" + NetworkHelper.GenerateQueryParameters(otherParameters)); webRequest.Method = "POST"; webRequest.ContentType = "image/" + outputSettings.Format.ToString(); webRequest.ServicePoint.Expect100Continue = false; - using (var requestStream = webRequest.GetRequestStream()) { - ImageOutput.SaveToStream(image, requestStream, outputSettings); - } - - responseString = NetworkHelper.GetResponse(webRequest); - using (WebResponse response = webRequest.GetResponse()) { - LogCredits(response); - using (StreamReader reader = new StreamReader(response.GetResponseStream(), true)) { - responseString = reader.ReadToEnd(); + try { + using (var requestStream = webRequest.GetRequestStream()) { + ImageOutput.SaveToStream(image, requestStream, outputSettings); } + + using (WebResponse response = webRequest.GetResponse()) { + using (StreamReader reader = new StreamReader(response.GetResponseStream(), true)) { + responseString = reader.ReadToEnd(); + } + LogCredits(response); + } + } catch (Exception ex) { + LOG.Error("Upload to imgur gave an exeption: ", ex); + throw ex; } } else { OAuthSession oAuth = new OAuthSession(ImgurCredentials.CONSUMER_KEY, ImgurCredentials.CONSUMER_SECRET);