There is an interesting and very useful extension nsimage
which effectively replaces the functionality of existing
ns_jpegsize and ns_gifsize built-in commands, adding
support for png images as well.
Idea is to integrate this into the core since it
effectively
adds more features, while providing the backwards
compat to existing commands.