drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.56k stars 480 forks source link

Aspect Ratio of JPG Images #494

Closed YJ14 closed 4 years ago

YJ14 commented 4 years ago

Hello, I am extracting metadata of JPG images; width and height from the JpegDirectory but i can't find any info about the Aspect Ration. I've checked other directories too, but no details about it. Is there something that I am missing or it was not planned as a part of the metadata?

kwhopper commented 4 years ago

Is there a specific 'aspect ratio' tag that you're after? Aspect ratio is just a comparison between width and height so you can also simply infer it. Or maybe you mean some kind of orientation?

YJ14 commented 4 years ago

Thanks for the reply. I mean the "16:9" or "4:3" etc.. Aspect Ratio... I did calculated it with the Greatest Common Divisor. But would be nice to have it in the Library 👍

kwhopper commented 4 years ago

I was about to mention that :-)

I don't think that is part of the library right now, but there have been numerous discussions on derived types/tags in the past:

https://github.com/drewnoakes/metadata-extractor/issues/10

Your issue fits into that discussion I think.

drewnoakes commented 4 years ago

Thanks for the suggestion. As @kwhopper says you can calculate this value yourself by width / height. I've included aspect ratio as an additional idea in support of #10, so will track the idea there.