Skip to content

Instantly share code, notes, and snippets.

@Kevin-Bronsdijk
Last active June 27, 2016 06:48
Show Gist options
  • Save Kevin-Bronsdijk/ab5d3ffab53756f727d56b2ec2d7423b to your computer and use it in GitHub Desktop.
Save Kevin-Bronsdijk/ab5d3ffab53756f727d56b2ec2d7423b to your computer and use it in GitHub Desktop.
var request = new OptimizeSetUploadWaitRequest()
{
// Request level settings
Lossy = true,
};
request.AddSet(new ResizeImageSet {
// Individual settings
Name = "set1", Height = 10, Width = 10, Lossy = false
});
request.AddSet(new ResizeImageSet {
// Individual settings
Name = "set2", Height = 15, Width = 15, SamplingScheme = SamplingScheme.S444
});
var response = client.OptimizeWait("c:\your-image-location-on-disk.jpeg", request);
if(response.Result.StatusCode == HttpStatusCode.OK)
{
foreach (var item in result.Body.Results)
{
var url = item.KrakedUrl;
}
}
$files = Get-ChildItem 'C:\path\..\myfolder' -Filter *.png, *.jpg, *.jpeg
$result = Optimize-ImageToS3 -FilePath $files.FullName -Key $key -Secret $secret -Wait $true `
-AmazonKey $amazonKey -AmazonSecret $amazonSecret -AmazonBucket $amazonBucket -S3Path 'powershell/'
$result | Format-Table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment