GNU bug report logs -
#56317
28.1; image-convert not working on Windows
Previous Next
Reported by: Pascal Quesseveur <pquessev <at> gmail.com>
Date: Thu, 30 Jun 2022 06:17:01 UTC
Severity: normal
Found in version 28.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 56317 <at> debbugs.gnu.org (full text, mbox):
> From: Pascal Quesseveur <pquessev <at> gmail.com>
> Date: Thu, 30 Jun 2022 08:16:43 +0200
>
>
> image-converter dosesn(t work with emacs 28.1 on Windows
> 10. I start with:
>
> runemacs -Q
>
> then:
>
> (auto-image-file-mode 1)
> (setq image-use-external-converter t
> image-converter 'graphicsmagick)
>
> GrpahicsMagick 1.3.36 Q16 win64 is installed and working fine. I can
> test an image in SunRaster format:
>
> (image-convert-p "C:/Users/.../img.ras") -> image-convert
>
> then I enter:
>
> (add-to-list 'auto-mode-alist '("\\.ras\\'" . image-mode))
>
> and if I visit the sunraster file I get the following error in the
> Messages buffer:
>
> Not a PNG image: ‘(image :type png :data \211PNG
> ^Z
> ...
>
Thanks. Please try the patch below:
diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index 460ff16..43903ff 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -227,19 +227,21 @@ image-converter--mime-type
(cadr (split-string (symbol-name image-format) "/"))))
(defun image-converter--convert-magick (type source image-format)
- (let ((command (image-converter--value type :command)))
+ (let ((command (image-converter--value type :command))
+ (coding-system-for-read 'no-conversion))
(unless (zerop (if image-format
;; We have the image data in SOURCE.
(progn
(insert source)
- (apply #'call-process-region (point-min) (point-max)
- (car command) t t nil
- (append
- (cdr command)
- (list (format "%s:-"
- (image-converter--mime-type
- image-format))
- "png:-"))))
+ (let ((coding-system-for-write 'no-conversion))
+ (apply #'call-process-region (point-min) (point-max)
+ (car command) t t nil
+ (append
+ (cdr command)
+ (list (format "%s:-"
+ (image-converter--mime-type
+ image-format))
+ "png:-")))))
;; SOURCE is a file name.
(apply #'call-process (car command)
nil t nil
This bug report was last modified 3 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.