Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Better report version number for potrace and ImageMagick
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaem committed Aug 31, 2022
1 parent 2fb0f43 commit a521a81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pdfsak
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def checkImageMagick():
ver = subprocess.run(["magick", "--version"], capture_output=True, text=True)
except FileNotFoundError:
return res_class(False, None, None)
ver_stdout = ver.stdout.strip().replace("Version: ImageMagick ", "")
return res_class(True, ver_stdout, ver.stderr.strip())
return res_class(True, ver.stdout.strip(), ver.stderr.strip())


def checkImageMagickCLI():
Expand All @@ -277,6 +276,7 @@ def checkImageMagickCLI():
else:
r = res.stdout.split("\n")[0]
r = r.replace("https://imagemagick.org", "")
r = r.replace("Version: ImageMagick ", "")
print(f"ImageMagick OK: {r}")
return res

Expand All @@ -297,6 +297,8 @@ def checkPotraceCLI():
else:
r = res.stdout.split("\n")[0]
r = r.replace("potrace", "").strip().split()[0]
if r[-1]==".":
r = r[:-1]
print(f"Potrace OK: {r}")
return res

Expand All @@ -317,6 +319,8 @@ def checkMKBitmapCLI():
else:
r = res.stdout.split("\n")[0]
r = r.replace("mkbitmap", "").strip().split()[0]
if r[-1]==".":
r = r[:-1]
print(f"mkbitmap OK: {r}")
return res

Expand Down

0 comments on commit a521a81

Please sign in to comment.