Skip to content

Commit

Permalink
Added space after %U in imagemagick identify format prameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mexthecat committed Sep 27, 2024
1 parent 407c028 commit 372f725
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ocrd_models/ocrd_exif.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def run_identify(self, img):
for prop in ['compression', 'photometric_interpretation']:
setattr(self, prop, img.info[prop] if prop in img.info else None)
if img.filename:
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U', img.filename], check=False, stderr=PIPE, stdout=PIPE)
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', img.filename], check=False, stderr=PIPE, stdout=PIPE)
else:
with BytesIO() as bio:
img.save(bio, format=img.format)
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U', '/dev/stdin'], check=False, stderr=PIPE, stdout=PIPE, input=bio.getvalue())
ret = run(['identify', '-format', r'%[resolution.x] %[resolution.y] %U ', '/dev/stdin'], check=False, stderr=PIPE, stdout=PIPE, input=bio.getvalue())
if ret.returncode:
stderr = ret.stderr.decode('utf-8')
if 'no decode delegate for this image format' in stderr:
Expand Down

0 comments on commit 372f725

Please sign in to comment.