How to read png meta data from JavaScript?

My custom server embeds meta data about an image in the PNG meta data fields. The image is loaded via a regular img tag. I’d like to access the meta data from JavaScript – any way to achieve this?

If not, what are the alternatives for serving additional information for an image? The images are generated on the fly and are relatively expensive to produce, so I’d like to serve the meta data and the image data in a single round trip to the server.

59 thoughts on “How to read png meta data from JavaScript?”

Leave a Comment