Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ctolkien committed Sep 6, 2016
1 parent bed97a2 commit 47ee150
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,34 @@ using (var png = new TinyPngClient("yourSecretApiKey"))

The same `Byte[]`, `Stream` and `File` path API's are available from the result of the `Resize()` method.

### Compression Count
## Amazon S3 Storage

The result of any compress operation can be stored directly on to Amazon S3 storage. There are two ways to configure this.

If you're going to be storing images for most requests onto S3, then you can pass in an `AmazonS3Configuration` object to the constructor.

```csharp
using (var png = new TinyPngClient("yourSecretApiKey", new AmazonS3Configuration("awsAccessKeyId", "awsSecretAccessKey", "defaultRegion")))
{
var compressedCat = await png.Compress("cat.jpg");
var s3Uri = await png.SaveCompressedImageToAmazonS3(compressedCat, "bucket/file-name.png");
}

```

You can also pass a `AmazonS3Configuration` object directly into calls to `SaveCompressedImageToAmazonS3`

```csharp
using (var png = new TinyPngClient("yourSecretApiKey"))
{
var compressedCat = await png.Compress("cat.jpg");
var s3Uri = await png.SaveCompressedImageToAmazonS3(compressedCat, new AmazonS3Configuration("awsAccessKeyId", "awsSecretAccessKey", "defaultRegion"), "bucket/file-name.png");
}

```


## Compression Count

You can get a read on the number of compression operations you've performed by inspecting the `CompressionCount` property
on the result of any operation you've performed. This is useful for keeping tabs on your API usage.
Expand Down
2 changes: 1 addition & 1 deletion src/TinyPNG/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
}
}
},
"version": "1.2.0-*"
"version": "1.3.0-*"
}

0 comments on commit 47ee150

Please sign in to comment.