Getting JPG dimensions without loading the entire file

Antti Kupila has posted a very useful utility for fetching jpg dimensions without the need to load the entire file.

This may come very handy in cases when you want to draw background or position other screen elements based on the jpg dimensions.

According to the author the class does not work with some jpg files (which probably do not have correct headers) so its 100% reliable only with jpegs you know / you have created.

Thanks Antti for sharing this class.

Script Image: 
util.jpg
Script author: 
Antti Kupila