This commit is contained in:
Kovid Goyal
2019-04-27 07:58:07 +05:30
parent d5846282a9
commit 1c4f5b471d

View File

@@ -61,7 +61,7 @@ def run_imagemagick(path, cmd, keep_stdout=True):
def identify(path):
p = run_imagemagick(path, ['identify', '-format', '%m %w %h %A', path])
p = run_imagemagick(path, ['identify', '-format', '%m %w %h %A', '--', path])
parts = tuple(filter(None, p.stdout.decode('utf-8').split()))
mode = 'rgb' if parts[3].lower() == 'false' else 'rgba'
return ImageData(parts[0].lower(), int(parts[1]), int(parts[2]), mode)
@@ -70,7 +70,7 @@ def identify(path):
def convert(path, m, available_width, available_height, scale_up, tdir=None):
from tempfile import NamedTemporaryFile
width, height = m.width, m.height
cmd = ['convert', '-background', 'none', path]
cmd = ['convert', '-background', 'none', '--', path]
scaled = False
if scale_up:
if width < available_width: