Skip to content

Commit

Permalink
Merge pull request #4 from tinpham5614/brink-tinify-compression-method
Browse files Browse the repository at this point in the history
apikey parameter
  • Loading branch information
brinkbrink authored Aug 2, 2023
2 parents 645a431 + 6472a0b commit 3276dec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/compress_image/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ private String convertToBase64(byte [] byteInput) {
* @return byte [] compressed image
*/

private String tinifyCompress(byte [] image) {
Tinify.setKey("YOUR_API_KEY");
private String tinifyCompress(byte [] image, String apiKey) {
Tinify.setKey(apiKey);
Source source = Tinify.fromBuffer(image);
return source.toBuffer();
}

0 comments on commit 3276dec

Please sign in to comment.