I'm using from PIL import Image, ExifTags
to access exif data of images.
exif.get('ExposureTime')
returns 0.008
but I would like it expressed as 1/125
. I can see this value under the ExposureTime
dict. But how do I access it?
I'm using from PIL import Image, ExifTags
to access exif data of images.
exif.get('ExposureTime')
returns 0.008
but I would like it expressed as 1/125
. I can see this value under the ExposureTime
dict. But how do I access it?
You need to get the reciprocal 1/x
. So 1/0.008 = 125
. Since the shutter speed is stored as a float you just need to format it as a string "1/"+str(1/0.008)
will result in 1/125