<< More Tutorials
How to use rethumb in Java?
To use rethumb in Java try the following code:
import java.io.FileOutputStream;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
public class JavaRethumbExample
{
public static void main(String [] args) throws Exception {
URL website = new URL("http://api.rethumb.com/v1/width/100/http://factor45.org/images/beach.jpg");
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream("beach.thumb.jpg");
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
}
}
Start using this example now
Use the following commands to get started:
$ git clone https://github.com/rethumb/rethumb-java-examples.git
$ cd rethumb-java-examples
$ ... Use your IDE of choice to handle the file "generic.java"
More examples using Java
How to use rethumb in Java?
How to resize an image by width in Java using rethumb?
How to resize an image by height in Java using rethumb?
How to resize an image by width and height in Java using rethumb?
How to create a square thumbnail from an image in Java using rethumb?
How to read Exif data in json format from an image in Java using rethumb?
How to make an image responsive in Java using rethumb?
How to read GPS coordinates from an image in Java using rethumb?
How to convert an image to JPG, GIF, PNG, TIF or WebP in Java using rethumb?
How to resize an image to cover any dimensions in Java using rethumb?