From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/51548 Path: main.gmane.org!not-for-mail From: Marshall T. Vandegrift Newsgroups: gmane.emacs.gnus.general Subject: `gnus-face-from-file' encoding issues Date: Wed, 16 Apr 2003 21:33:42 -0400 Sender: ding-owner@lists.math.uh.edu Message-ID: <873ckh9abt.fsf@rpi.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1050543243 26051 80.91.224.249 (17 Apr 2003 01:34:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 17 Apr 2003 01:34:03 +0000 (UTC) Original-X-From: ding-owner+M92@lists.math.uh.edu Thu Apr 17 03:34:01 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 195yHp-0006lr-00 for ; Thu, 17 Apr 2003 03:34:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 195yHz-0003hh-00; Wed, 16 Apr 2003 20:34:11 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 195yHu-0003hc-00 for ding@lists.math.uh.edu; Wed, 16 Apr 2003 20:34:06 -0500 Original-Received: (qmail 14345 invoked by alias); 17 Apr 2003 01:34:05 -0000 Original-Received: (qmail 14340 invoked from network); 17 Apr 2003 01:34:05 -0000 Original-Received: from alb-24-194-32-10.nycap.rr.com (HELO tiktok) (24.194.32.10) by sclp3.sclp.com with SMTP; 17 Apr 2003 01:34:05 -0000 Original-Received: from llasram by tiktok with local (Exim 4.12) id 195yHX-0000wn-00 for ding@gnus.org; Wed, 16 Apr 2003 21:33:43 -0400 Original-To: ding@gnus.org User-Agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAACrq6tpaWnU1NSO jo7///9ISEgoKCit8pKhAAACWElEQVR4nHWTQW/bMAyFiWGIz4rV7bqwgnJ2ZPcuR0jOmZF7 KwTUNcgG6+/vMWmLtsiYi8FPj3okFTr+J+jD98YN90Ev+eEumJZyuguOYelXd8Fx6nl1Fxwn M27vgsPQ8cNXME0hhOEY4heAZJiCeWvlHXTboLHcfgGTaQdV7E7DZ9DHqyDs5JOrqbNmUkXn 5VVyA51N7VUAIB/sBusS6sNWLyKP72AwCQDpEDZS5GV4BVOXmBmXTwpETu0NHDyzc445oZMf UkpO4QZKnasIaDJwK5J5OyjAeqrAFAqNzhcpeVyFq2IUmTliet0u4xMKp2BKLHKulwhTOCLz DIBjdGCAsmjyNrRjlloBGNdTryCbc15htKptYMRtj7RhTMF1+5MJoffjTyIPh3GgUQAeu+UL bHXMnha4CLVIBbntUsRwTSw7musMSSKfs3BsnU4Xs9lRUZAZAKbqhQE6E5f7qgBnUcoLycVG Y0wXzR6GRbzPNHIGyO4KbLuv6EQHpqUKiWMFpg27c3MlmVh8oepytFfyhBZRrAjhCqEqczYW v7DhoqQKYQO+1Cx/jU3JmD760uj9GACizOKQj234nZbropMkzctzTti7i+0wmuRlrgWuSini q2TPzoTDCRUZS0EL86zZM814BIf1ylo7YsFCpczYM1FzSe3xqTHGxqSbpDWm+UxECxuG6fzd JAsXrK5qOZMGXuaeVmgGZNT51VuevoUlNS4lG6NKMH56DXws8OoQKoGr8xuhJmfG+04qQR+3 5Ez0Hf+Om0RBWqui1l9Ef/pRTo5HF1HsH5ecMp4LrZOPAAAAAElFTkSuQmCC Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:51548 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:51548 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable Hi, I was experiencing a problem where `gnus-face-from-file' was creating invalid PNG images. I tracked the problem down to my use of `prefer-coding-system' to give highest priority to a multibyte coding system. Apparently `mm-with-unibyte-buffer' isn't sufficient when a string inserted into it has already been decoded from its source as multibyte. My solution was to specify `coding-system-for-read' as `binary' for the call to `gnus-shell-command-to-string', and I have attached a patch to that effect (against ognus-0.18). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gnus-fun.el.diff Content-Transfer-Encoding: quoted-printable Content-Description: patch for gnus-fun.el --- ognus-0.18/lisp/gnus-fun.el 2003-03-31 12:49:14.000000000 -0500 +++ ognus-0.18-patched/lisp/gnus-fun.el 2003-04-16 21:12:03.000000000 -0400 @@ -107,10 +107,11 @@ (while (and (not done) (> quant 1)) (setq attempt - (gnus-shell-command-to-string - (format gnus-convert-image-to-face-command - (shell-quote-argument (expand-file-name file)) - quant))) + (let ((coding-system-for-read 'binary)) + (gnus-shell-command-to-string + (format gnus-convert-image-to-face-command + (shell-quote-argument (expand-file-name file)) + quant)))) (if (> (length attempt) 740) (progn (setq quant (- quant 2)) --=-=-= Content-Transfer-Encoding: quoted-printable --=20 Marshall T. Vandegrift This is the manner of noble souls: they do not want to have anything for nothing; least of all, life. -- Friedrich Nietzsche, /Thus Spoke Zarathustra/ --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+ngR3aQb6rnTjFokRAhamAJ9TK0RnMfNU5zttF79A47N1h5lj3wCgj6TI 3oJFnN4MVqZGhnaOIvCXrjY= =KHVp -----END PGP SIGNATURE----- --==-=-=--