JSON App For Image Info

I’ve made a few JSON apps as long as I have paid hosting. Most of these are non-practical for the average user and I only make them for my own personal internet use. Here is one that anyone can use. It returns image dimensions, bit size, mime type and more info about any image.

Here is the source so you can self host an app like this: http://jakeis.com/json/image_info/index.php?source I have shared economy Godaddy hosting now and I have no longer have my dedicated IP with SSL so this application/json will not embed on https websites.

I make my apps weird because I’m self taught. The /image_url goes at the end. A little .js is optional at the very because I’m weird about embedded javascript elements. The /callback/ goes at the beginning of the url. An optional /argument/ goes in the middle, but it only gets used when adding AS_ARG or AS_ZERO to the end of the callback function so the argument will become an argument or become a property 0 of the callback object.

Click “Generate” and see. It’s easier to show than explain.

Image:

JSON URL:

Callback Style:


This is an iFrame that shows the JSON.

In retrospect, you can already do this with javascript, but my intent for JSON is so you can get this info prior to the image load. Of course if you use my thing on my server external to yours, it becomes JSONp which also is not synchronous.

Also, the reason I use $_SERVER["REQUEST_URI"] instead of a $_GET["query"] like a normal callback app, is because many hosts blacklist entire URLs passed as queries. Also the query of the url in query gets included this way.

Leave a Reply

Your email address will not be published. Required fields are marked *