Programming Tips - How can I get the width and height of an image for use a program or script?

Date: 2016apr26 Product: ImageMagick Keywords: magic Q. How can I get the width and height of an image for use a program or script? A. Use identify from ImageMagick
identify -format '%w' THE_IMAGE.jpg identify -format '%h' THE_IMAGE.jpg
This will just display the width and height. In a bash script:
width=$(identify -format '%w' THE_IMAGE.jpg) height=$(identify -format '%h' THE_IMAGE.jpg)