TinyPNG
TinyPNG copied to clipboard
Added missing background transform to TinyPNG convert call
This fixes #57
Rather than serializing twice in the scenario that we have a background transform, we can just supply the value if we have it. The JSON serializer settings we're using will omit any null values.
string requestBody = JsonSerializer.Serialize( new { convert = new { type = convertOperation }, transform = !string.IsNullOrEmpty(backgroundTransform) ? new { background = backgroundTransform } : null }, TinyPngClient._jsonOptions);
Fair point, done.
@ctolkien Any chance this could be released to NuGet?
On that note, are there any other issues you wanted resolving before releasing v4 properly? Happy to help out.
@manzanotti - v4 has gone to NuGet. Thanks for your help in this one!
https://github.com/ctolkien/TinyPNG/releases/tag/4.0.0