<< More Tutorials
How to read Exif data in json format from an image in Kotlin using rethumb?
To read Exif data in json format from an image in Kotlin use the following code:
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.URL
object KotlinRethumbExifExample {
@Throws(Exception::class)
@JvmStatic fun main(args: Array<String>) {
val url = URL("http://api.rethumb.com/v1/exif/all/http://images.rethumb.com/image_exif_1.jpg")
val reader = BufferedReader(InputStreamReader(url.openStream()))
var s = reader.readLine()
while (s != null) {
println(s)
s = reader.readLine()
}
// Use your favorite json library to parse the response!
}
}
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 read-exif-data-in-json.kt -include-runtime -d read-exif-data-in-json.jar
$ java -jar read-exif-data-in-json.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?