tinify / tinify-java

Java client for the Tinify API.

Home Page:https://tinypng.com/developers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Central MIT License Java CI/CD

Tinify API client for Java

Java client for the Tinify API, used for TinyPNG and TinyJPG. Tinify compresses your images intelligently. Read more at http://tinify.com.

Documentation

Go to the documentation for the Java client.

Installation

Install the API client via Maven:

<dependency>
  <groupId>com.tinify</groupId>
  <artifactId>tinify</artifactId>
  <version>1.8.8</version>
</dependency>

Usage

import com.tinify.*;
import java.io.IOException;

public class Compress {
  public static void main(String[] args) throws java.io.IOException {
    Tinify.setKey("YOUR_API_KEY");
    Tinify.fromFile("unoptimized.png").toFile("optimized.png");
  }
}

Running tests

mvn test

Integration tests

TINIFY_KEY=$YOUR_API_KEY mvn -Pintegration integration-test

License

This software is licensed under the MIT License. View the license.

About

Java client for the Tinify API.

https://tinypng.com/developers

License:MIT License


Languages

Language:Java 99.5%Language:Shell 0.5%