Last active
June 27, 2016 06:48
-
-
Save Kevin-Bronsdijk/ab5d3ffab53756f727d56b2ec2d7423b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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