From fd71d2035d7908514ebd9c11070242ca62951759 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Jan 2023 11:02:56 +0530 Subject: [PATCH] Start work on rendering with ImageMagick --- tools/cmd/icat/magick.go | 13 +++++++++++++ tools/cmd/icat/process_images.go | 9 ++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 tools/cmd/icat/magick.go diff --git a/tools/cmd/icat/magick.go b/tools/cmd/icat/magick.go new file mode 100644 index 000000000..40c8bf8d2 --- /dev/null +++ b/tools/cmd/icat/magick.go @@ -0,0 +1,13 @@ +// License: GPLv3 Copyright: 2023, Kovid Goyal, + +package icat + +import ( + "fmt" +) + +var _ = fmt.Print + +func render_image_with_magick(imgd *image_data, src *opened_input) error { + return nil +} diff --git a/tools/cmd/icat/process_images.go b/tools/cmd/icat/process_images.go index c531629c2..f1f49eacf 100644 --- a/tools/cmd/icat/process_images.go +++ b/tools/cmd/icat/process_images.go @@ -253,11 +253,14 @@ func process_arg(arg input_arg) { c, format, err := image.DecodeConfig(f.file) f.Rewind() imgd := image_data{source_name: arg.value} - if err != nil { - report_error(arg.value, "Unknown image format", err) + if !keep_going.Load() { return } - if !keep_going.Load() { + if err != nil { + err = render_image_with_magick(&imgd, &f) + if err != nil { + report_error(arg.value, "ImageMagick failed", err) + } return } imgd.canvas_width = c.Width