-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added missing background transform to TinyPNG convert call #56
Conversation
This fixes #57 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
93c7cc4
to
2d413f1
Compare
Fair point, done. |
2d413f1
to
c05d953
Compare
@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! |
No description provided.