Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX - High Sierra support #3

Open
rlxmp opened this issue Aug 2, 2018 · 3 comments
Open

OSX - High Sierra support #3

rlxmp opened this issue Aug 2, 2018 · 3 comments

Comments

@rlxmp
Copy link

rlxmp commented Aug 2, 2018

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.

@SK-Hardwired
Copy link
Owner

Sorry, I have no MacOS X to test and not aware about possible matplotlib or exiftool libs specific operations.

@mikeMikeymike
Copy link

mikeMikeymike commented Nov 3, 2019

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.

@fredstreitz1
Copy link

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... :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants