I can get PPI for a JPEG image using the following command:
$ identify -format \"%w x %h %x x %y\" mypic.jpg 1600 x 1200 72 PixelsPerInch x 72 PixelsPerInch
You can simply add the option
-units PixelsPerInch