-
Notifications
You must be signed in to change notification settings - Fork 178
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
Any chance to display an image? #49
Comments
You can do this by using |
I took a look at your PR, and it seems to be previewing an image on disk. I was initially thinking about directly previewing an image in memory, like by directly transforming an |
Oh, I see. If you submit a Pull Request with the changes I'd be happy to review it. |
Actually that's the problem: I cannot show the image. 2018-12-01 11:43:28.040 Python[42369:18111772] Traceback (most recent call last):
File "/Users/joker/Works/rumps/rumps/rumps.py", line 1035, in callback_
return _call_as_function_or_method(callback, self)
File "/Users/joker/Works/rumps/rumps/rumps.py", line 384, in _call_as_function_or_method
return method(event)
File "simple.py", line 20, in sayhi
rumps.show_image('/Users/joker/Downloads/256.png')
File "/Users/joker/Works/rumps/rumps/rumps.py", line 212, in show_image
return _nsimage_window_from_file(image)
File "/Users/joker/Works/rumps/rumps/rumps.py", line 277, in _nsimage_window_from_file
window = NSImageView.alloc().init(image)
TypeError: Need 0 arguments, got 1 I worked around by using this instead of window = NSImageView.alloc().init()
window.setImage_(image) This time I got no error, but the image did not show up either. Now that I know how to converting raw bytes into an data = NSData.dataWithBytes_length_(raw_bytes, len(raw_bytes))
image = NSImage.alloc().initWithData_(data) |
Like popup quick view window for an image in memory, rather than saving it to disk before programmatically open it via "Preview" app. Is that possible now? Or would you consider implementing this feature?
The text was updated successfully, but these errors were encountered: