<< More Tutorials
How to use rethumb in Kotlin?
To use rethumb in Kotlin try the following code:
import java.io.FileOutputStream
import java.net.URL
import java.nio.channels.Channels
object KotlinRethumbGenericExample {
@Throws(Exception::class)
@JvmStatic fun main(args: Array<String>) {
val website = URL("http://api.rethumb.com/v1/width/100/http://factor45.org/images/beach.jpg")
val rbc = Channels.newChannel(website.openStream())
val fos = FileOutputStream("beach.thumb.jpg")
fos.channel.transferFrom(rbc, 0, java.lang.Long.MAX_VALUE)
}
}
Start using this example now
Use the following commands to get started:
$ git clone https://github.com/rethumb/rethumb-kotlin-examples.git
$ cd rethumb-kotlin-examples
$ kotlinc generic.kt -include-runtime -d generic.jar
$ java -jar generic.jar
More examples using Kotlin
How to use rethumb in Kotlin?
How to resize an image by width in Kotlin using rethumb?
How to resize an image by height in Kotlin using rethumb?
How to resize an image by width and height in Kotlin using rethumb?
How to create a square thumbnail from an image in Kotlin using rethumb?
How to read Exif data in json format from an image in Kotlin using rethumb?
How to make an image responsive in Kotlin using rethumb?
How to read GPS coordinates from an image in Kotlin using rethumb?
How to convert an image to JPG, GIF, PNG, TIF or WebP in Kotlin using rethumb?
How to resize an image to cover any dimensions in Kotlin using rethumb?