Extracting original image width and height into MIE sidecar

Started by ExploreCams, September 28, 2022, 03:25:15 AM

Previous topic - Next topic

ExploreCams

Hello, I was wondering if it's possible to store original width and height data into MIE? Thanks.
https://explorecams.com - collection of sample images captured with various camera models & lenses

Phil Harvey

I will add a MIE:OriginalImageSize tag in ExifTool 12.46 so you can store this information without having to create a user-defined tag.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ExploreCams

Quote from: Phil Harvey on September 28, 2022, 06:38:58 AMI will add a MIE:OriginalImageSize tag in ExifTool 12.46 so you can store this information without having to create a user-defined tag.

- Phil

Hi Phil, while looking through the documentation I have found -imagesize , maybe this is the same?

I am running this right now:
exiftool -tagsfromfile image.jpg -imagesize -exif -xmp -iptc image.mie
The only downside is when doing exiftool -json image.mie I need to manually set ImageWidth and ImageHeight to have a similar output I would get if requesting image.jpg.

If it would be possible to somehow have both MIE:ImageWidth and MIE:ImageHeight stored and be able to read from sidecar without extra step it would be perfect. :-)
https://explorecams.com - collection of sample images captured with various camera models & lenses

Phil Harvey

I thought you meant the size of the original image before cropping.  But if you just mean the size of the corresponding image, then ImageSize is the correct thing to write.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ExploreCams

Quote from: Phil Harvey on September 28, 2022, 04:55:28 PMI thought you meant the size of the original image before cropping.  But if you just mean the size of the corresponding image, then ImageSize is the correct thing to write.

- Phil

Indeed, I am creating MIE sidecar from the original image at the moment and learned that ImageWidth and ImageHeight were not carried by default.
Is there any way to populate ImageWidth and ImageHeight if ImageSize exists via a command line when outputting json?


One more a little bit unrelated question, when doing exiftool -json image.jpg is there a way to remove "SourceFile" from the final output via a command-line?

Thanks.
https://explorecams.com - collection of sample images captured with various camera models & lenses

Phil Harvey

Quote from: ExploreCams on September 29, 2022, 03:08:40 AMIs there any way to populate ImageWidth and ImageHeight if ImageSize exists via a command line when outputting json?

You could create user-defined Composite tags to generate ImageWidth and ImageHeight from MIE:ImageSize.  Or you could override the MIE:ImageSize definition to generate separate ImageWidth/Height tags.  Or you could use some other tags like ExifImageWidth/Height.

QuoteOne more a little bit unrelated question, when doing exiftool -json image.jpg is there a way to remove "SourceFile" from the final output via a command-line?

Not via ExifTool, but you could run the output through a stream editor like sed.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).