-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Can't set command used for show() #4643
Comments
Should probably make a separate issue for this but I'd like to add that as a user with no experience with ImageMagick I find |
Looking at git history, the Lines 1480 to 1483 in 9a640e3
Lines 2121 to 2127 in 9a640e3
ImageShow.py ignores all options The proper way to override the command is to extend one of the The docs are therefore wrong, and the parameter should be deprecated and removed - see #4646. I believe the default viewer was chosen based on system support, but both the default You don't mention what OS you are using, other than "Linux". Can you please be more specific (including version)? |
I am using Void Linux 5.4. And yeah I see, I tried digging at the code for the show() method and there seemed to be an option to register your own command but I didn't fully grasp the logic. It is not properly implemented but at the same time, it doesn't actually throw an exception if you use it, it just quietly ignores it, which was confusing when coupled with the outdated documentation. I'm a bit surprised I was the first person to report this. I agree with the idea, the current defaults are awfully outdated, I think perhaps respecting the user's default application for that mimetype would be better. |
Fun fact, that documentation has always been wrong! 😃 It was added 7 years ago in #280: 25b6371#diff-3fef5f960d5bd8bdfb9c6fadcf96af22L1479-R1461 |
I've created PR #4695 as another option, to actually use the |
Fyi, xdg-open has been around since 2006, before the most recent version of PIL was released in 2009. I'm not opposed to the idea of adding it as another viewer, but could someone make an argument why it should be the default? |
I suggested it because |
Hi I had a play with this and managed: """Use geeqie as a PIL.Image.show viewer"""
import PIL.ImageShow as show
class GeeqieViewer(show.UnixViewer):
"""Inherit from given class."""
# pylint: disable=too-few-public-methods,no-self-use,unused-argument
def get_command_ex(self, file, **options):
"""Define a shell command line"""
command = "geeqie -t " # -t launches without toolbar
executable = "/usr/bin/geeqie"
return command, executable
if show.shutil.which('geeqie'):
show.register(GeeqieViewer, -1) Incidentally, there seems to be a bug in ImageShow.register: if order > 0:
_viewers.append(viewer)
elif order < 0:
_viewers.insert(0, viewer) which would silently ignore calling with Cheers |
@FergusonTG fair enough. I've created PR #4706 to correct this. |
:-) |
#4646 has been merged, so the |
I'm trying to change the command used to display the image with show() from
display
topqiv
but it seems to just ignore any options I put.The text was updated successfully, but these errors were encountered: