Flog

IMG·2·JSON is a image metadata extractor that's JSON savvy

IMG2JSON by Adam Burmister
Version 1.1

What is IMG·2·JSON

IMG·2·JSON is a simple Google App Engine python application which extracts metadata from images and returns the results as a JSON string.

Live Demo

Run the demo — 640x480 Photo with EXIF data

(No results yet, click the button above to begin the request)

How do I use it?

To use IMG·2·JSON all you need to do is perform a request for the fetcher-script URL hosted on Google App Engine.

Request Parameters

url
(required) The URL of the image
callback
A callback function string. This will wrap around the returned JSON, allowing you to execute callbacks when you receive the response

Response Parameters

url
The URL of the image this metadata belongs to
mimeType
The detected mime–type of the image
width
Width of the image in pixels
height
Height of the image in pixels
byteSize
The file size of the image in bytes
exif
Any EXIF metadata extracted from the image (such as Camera Manufacturer, Model, Orientation, Date, GPS position, etc)

Example Usage

Build up the request URL

The first step is to build up the request URL:
http://img2json.appspot.com/go/?callback=myCallbackMethod&
  url=http://assets.flog.co.nz/favicon.png

In the URL above note the callback function set to "myCallbackMethod" and the URL set to "…favicon.png"

Request the URL and read the response

The result JSON returned by this request correctly identifies the images associated metadata and encloses the JSON object in the callback method:

myCallbackMethod({
	url: "http://assets.flog.co.nz/favicon.png",
	mimeType: "image/png",
	width: 16,
	height: 16,
	byteSize: 524,
	exif: {}
});

Credits

This application was written by Adam Burmister (www.flog.co.nz) in half an hour as a way to learn some Python and Google App Engine.

Powered by Google App Engine