From 573e19c3ad5a231d6dbcaf938ce28269bfb858f2 Mon Sep 17 00:00:00 2001 From: Chad Tolkien Date: Wed, 7 Sep 2016 10:36:35 +1000 Subject: [PATCH] cleanup --- README.md | 4 ++-- src/TinyPNG/TinyPng.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 187962b..487d3c4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![license](https://img.shields.io/github/license/ctolkien/TinyPNG.svg?maxAge=2592000)]() -This is a .NET wrapper around the [TinyPng.com](http://tinypng.com) image compression service. This is not an official TinyPNG.com product. +This is a .NET wrapper around the [TinyPNG.com](http://tinypng.com) image compression service. This is not an official TinyPNG.com product. * Supports .Net Core and full .Net Framework * Non-blocking async turtles all the way down @@ -136,5 +136,5 @@ on the result of any operation you've performed. This is useful for keeping tabs ```csharp var compressedCat = await png.Compress("cat.jpg"); -compressedCat.CompressionCount; +compressedCat.CompressionCount; // = 5 ``` diff --git a/src/TinyPNG/TinyPng.cs b/src/TinyPNG/TinyPng.cs index fc5c774..24b975b 100644 --- a/src/TinyPNG/TinyPng.cs +++ b/src/TinyPNG/TinyPng.cs @@ -21,7 +21,7 @@ public class TinyPngClient : IDisposable /// Wrapper for the tinypng.com API /// /// Your tinypng.com API key, signup here: https://tinypng.com/developers - public TinyPngClient(string apiKey) + public TinyPngClient(string apiKey) { if (string.IsNullOrEmpty(apiKey)) throw new ArgumentNullException(nameof(apiKey)); @@ -39,8 +39,8 @@ public TinyPngClient(string apiKey) { ContractResolver = new CamelCasePropertyNamesContractResolver() }; - jsonSettings.Converters.Add(new StringEnumConverter {CamelCaseText = true }); - + jsonSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true }); + } /// @@ -186,7 +186,7 @@ public async Task SaveCompressedImageToAmazonS3(TinyPngCompressResponse res amazonSettings.Path = pathBucket; - var amazonSettingsAsJson = JsonConvert.SerializeObject(new { store = amazonSettings }); + var amazonSettingsAsJson = JsonConvert.SerializeObject(new { store = amazonSettings }, jsonSettings); var msg = new HttpRequestMessage(HttpMethod.Post, result.Output.Url); msg.Content = new StringContent(amazonSettingsAsJson, System.Text.Encoding.UTF8, "application/json"); @@ -222,7 +222,7 @@ public async Task SaveCompressedImageToAmazonS3(TinyPngCompressResponse res if (!string.IsNullOrEmpty(regionOverride)) amazonSettings.Region = regionOverride; - + return await SaveCompressedImageToAmazonS3(result, amazonSettings, pathBucket); } @@ -242,5 +242,5 @@ protected virtual void Dispose(bool disposing) } #endregion } - + }