I create images from blender, and they lack Exif metadata, which I add using the bash command exiv2. (Because the software these images are passed to will use the metadata.)
For example, I can set the Image Width to 960 using exiv2 -M"set Exif.Image.ImageWidth 960" image.jpg and then read it out using exiv2 -g Exif.Image.ImageWidth -Pv image.jpg.
For a quick summary, I can do exiv2 image.jpg to get a list of set Exif metadata. This includes
$ exiv2 image.jpg
File name : image.jpg
File size : 32975 Bytes
MIME type : image/jpeg
Image size : 960 x 540
How can I use this Image size to set Exif.Image.ImageWidth and Exif.Image.ImageLength in bash?
The standard Exif tags don't list ImageSize.
As ghoti suggested, parsing the output works:
gives the width, and
the height.
I'm still hoping for a cleaner answer though.
Explanation of the sed command: