Open rlxmp opened 6 years ago
Sorry, I have no MacOS X to test and not aware about possible matplotlib or exiftool libs specific operations.
I got it to work on macOS Catalina by adding a couple lines and changing one of them. I'm not a python programmer, so there may be a better way, but this is working for me.
Near the top of the file, before the existing line:
import matplotlib.pyplot as plt
I added two two lines of code, so it looks like this:
import matplotlib;
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
Then search for this line (it's about line 140):
exifdata = subprocess.check_output(['exiftool','-a',F],shell=True,universal_newlines=True,stdin=subprocess.PIPE,stderr=subprocess.PIPE)
And comment it out and replace it with these two lines, so it looks like this:
# exifdata = subprocess.check_output(['exiftool','-a',F],shell=True,universal_newlines=True,stdin=subprocess.PIPE,stderr=subprocess.PIPE)
exifdata = subprocess.check_output(f"exiftool -a '{F}'",
shell=True,universal_newlines=True,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
replaced this line (it's around line 74)
# subprocess.call(['exiftool','-tagsFromFile',F,sname,'-overwrite_original_in_place'],shell=True)
subprocess.call( f"exiftool -tagsFromFile '{F}' '{sname}' -overwrite_original_in_place",shell=True)
Hope this helps someone.
Thanks, mikeMikeyMike! I added a couple of things to make this work with a new python installation on OS X Catalina:
First - at line 123 replaced:
fig.canvas.set_window_title(os.path.basename(F))
with
fig.canvas.manager.set_window_title(os.path.basename(F))
and at line 1236 replaced:
fig.canvas.set_window_title('AF Visualizer')
with
fig.canvas.manager.set_window_title('AF Visualizer')
to get rid of the error messages.
Then I noticed that the yellow circle noting Focus Location was not properly scaled on raw images (e.g., "Focus Location" might be 3008 2000 1334 904 on a image 6048x4024 - so I added the following two lines after 1153:
focusp[2]= focusp[2]*xpixels/focusp[0]
focusp[3]= focusp[3]*ypixels/focusp[1]
to scale the location appropriately. Now the Focus Location on the ARW and JPG images agree... :-)
Would love to see this adapted to work on OSX, specifically High Sierra. I don't know enough python to fix this but I am able to at least get the UI to launch with Python 2.7. However, when I click Open and chose the file nothing else happens or displays.