Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Imagizer Java Client

The official Java client for the Imagizer Media Engine.

The Imagizer Media Engine accelerates media delivery to your mobile Apps or Webpages by dynamically rescaling, cropping, and compressing images in real time. See all Imagizer features in our doc.

Install from JCenter or Maven

dependencies {
    compile 'com.nventify:ImagizerClient:0.1.4'
}

Build Jar from Source

gradle build

Unit Tests

gradle test

Basic Usage

Using the free to test Imagizer Demo Service

import com.nventify.ImagizerClient;

public class ImagizerClientExample {
    public static void main(String[] args) {
        ImagizerClient client = new ImagizerClient();
        client.setOriginHost("example.com");

        String url = client.buildUrl("image.jpg")
                .addParam("width", 200)
                .addParam("height", 400)
                .addParam("crop", "fit")
                .toString();

        System.out.println(url);
    }
}

// prints out
// http://demo.imagizercdn.com/image.jpg?crop=fit&height=400&hostname=example.com&width=200

Using your own Imagizer Instance

import com.nventify.ImagizerClient;

public class ImagizerClientExample {
    public static void main(String[] args) {
        ImagizerClient client = new ImagizerClient("your-imagizer-host.com");

        String url = client.buildUrl("image.jpg")
                .addParam("width", 200)
                .addParam("height", 400)
                .addParam("crop", "fit")
                .toString();

        System.out.println(url);
    }
}

// prints out
// http://your-imagizer-host.com/image.jpg?crop=fit&height=400&width=200