replace with fatal error

This commit is contained in:
nodlek-ctrl 2023-04-13 21:03:43 +10:00
parent 2e152c2bd4
commit a025d3ac5f

View File

@ -597,8 +597,8 @@ def magick_text(stdin, image_width, font_size, font_family):
'Pipe an io to ImageMagick for processing text to image, return output io'
read_fd, write_fd = os.pipe()
if _MagickExe is None:
error(i18n("imagemagick-not-found"))
exit(129)
fatal(i18n("imagemagick-not-found"), code=129)
subprocess.Popen([_MagickExe, '-background', 'white', '-fill', 'black',
'-size', f'{image_width}x', '-font', font_family, '-pointsize',
str(font_size), 'caption:@-', 'pbm:-'],
@ -609,8 +609,8 @@ def magick_image(stdin, image_width, dither):
'Pipe an io to ImageMagick for processing "usual" image to pbm, return output io'
read_fd, write_fd = os.pipe()
if _MagickExe is None:
error(i18n("imagemagick-not-found"))
exit(129)
fatal(i18n("imagemagick-not-found"), code=129)
subprocess.Popen([_MagickExe, '-', '-fill', 'white', '-opaque', 'transparent',
'-resize', f'{image_width}x', '-dither', dither, '-monochrome', 'pbm:-'],
stdin=stdin, stdout=io.FileIO(write_fd, 'w'))