mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 08:42:35 +03:00
Add support to use GraphicsMagick's "gm display" as viewer
This commit is contained in:
parent
ef864d72f1
commit
bb88d8d017
|
@ -18,6 +18,7 @@ All default viewers convert the image to be shown to PNG format.
|
||||||
The following viewers may be registered on Unix-based systems, if the given command is found:
|
The following viewers may be registered on Unix-based systems, if the given command is found:
|
||||||
|
|
||||||
.. autoclass:: PIL.ImageShow.DisplayViewer
|
.. autoclass:: PIL.ImageShow.DisplayViewer
|
||||||
|
.. autoclass:: PIL.ImageShow.GmDisplayViewer
|
||||||
.. autoclass:: PIL.ImageShow.EogViewer
|
.. autoclass:: PIL.ImageShow.EogViewer
|
||||||
.. autoclass:: PIL.ImageShow.XVViewer
|
.. autoclass:: PIL.ImageShow.XVViewer
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,15 @@ class DisplayViewer(UnixViewer):
|
||||||
return command, executable
|
return command, executable
|
||||||
|
|
||||||
|
|
||||||
|
class GmDisplayViewer(UnixViewer):
|
||||||
|
"""The GraphicsMagick ``gm display`` command."""
|
||||||
|
|
||||||
|
def get_command_ex(self, file, **options):
|
||||||
|
executable = "gm"
|
||||||
|
command = "gm display"
|
||||||
|
return command, executable
|
||||||
|
|
||||||
|
|
||||||
class EogViewer(UnixViewer):
|
class EogViewer(UnixViewer):
|
||||||
"""The GNOME Image Viewer ``eog`` command."""
|
"""The GNOME Image Viewer ``eog`` command."""
|
||||||
|
|
||||||
|
@ -220,6 +229,8 @@ class XVViewer(UnixViewer):
|
||||||
if sys.platform not in ("win32", "darwin"): # unixoids
|
if sys.platform not in ("win32", "darwin"): # unixoids
|
||||||
if shutil.which("display"):
|
if shutil.which("display"):
|
||||||
register(DisplayViewer)
|
register(DisplayViewer)
|
||||||
|
if shutil.which("gm"):
|
||||||
|
register(GmDisplayViewer)
|
||||||
if shutil.which("eog"):
|
if shutil.which("eog"):
|
||||||
register(EogViewer)
|
register(EogViewer)
|
||||||
if shutil.which("xv"):
|
if shutil.which("xv"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user