Created
November 30, 2011 23:03
-
-
Save omsai/1411673 to your computer and use it in GitHub Desktop.
Check Andor iQ image orientation on images between set date range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imagedisk | |
from datetime import datetime | |
id = imagedisk.iQImageDisk() | |
##print type(id[1091567616].getDateAndTimeObject()) | |
date_min = datetime(2011, 3, 7) | |
date_max = datetime(2011, 3, 10) | |
no_flip_rotation = 0 | |
flip_rotation = 0 | |
for im in id: | |
try: | |
date_time = im.getDateAndTimeObject() | |
if date_time >= date_min and date_time <= date_max: | |
##print date_time | |
try: | |
orientation_metadata = im.getDetails()[0]['Tab Image Orientation'] | |
except KeyError: | |
# No orientation field, so invalid image | |
continue | |
if orientation_metadata == 'Flip=None\r\nRotation in Degrees=None\r\n': | |
no_flip_rotation = no_flip_rotation + 1 | |
else: | |
flip_rotation = flip_rotation + 1 | |
print "Found", im.getTitle, "has", repr(orientation_metadata) | |
except ValueError: | |
# No date/time for e.g. processed image | |
pass | |
print "No flip or rotation:", no_flip_rotation | |
print "Flipped or rotated:", flip_rotation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment