From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/51591 Path: main.gmane.org!not-for-mail From: Gaute B Strokkenes Newsgroups: gmane.emacs.gnus.general Subject: Re: Coloured faces: 740 bytes is too much. Date: Fri, 18 Apr 2003 00:05:20 +0100 Organization: The Church of Emacs Sender: ding-owner@lists.math.uh.edu Message-ID: <87istcybbj.fsf@cam.ac.uk> References: <87u1d2pkxz.fsf@cam.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050635609 16286 80.91.224.249 (18 Apr 2003 03:13:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2003 03:13:29 +0000 (UTC) Original-X-From: ding-owner+M135@lists.math.uh.edu Fri Apr 18 05:13:27 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 196MJS-0004E8-00 for ; Fri, 18 Apr 2003 05:13:18 +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 196MJb-0002YK-00; Thu, 17 Apr 2003 22:13:27 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 196L93-0002Ra-00 for ding@lists.math.uh.edu; Thu, 17 Apr 2003 20:58:29 -0500 Original-Received: (qmail 88431 invoked by alias); 18 Apr 2003 01:58:29 -0000 Original-Received: (qmail 88426 invoked from network); 18 Apr 2003 01:58:29 -0000 Original-Received: from orange.csi.cam.ac.uk (exim@131.111.8.77) by sclp3.sclp.com with SMTP; 18 Apr 2003 01:58:29 -0000 Original-Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk.cam.ac.uk) by orange.csi.cam.ac.uk with esmtp (Exim 4.12) id 196L91-0003j1-00 for ding@gnus.org; Fri, 18 Apr 2003 02:58:27 +0100 Original-To: ding@gnus.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEWWWBTly7aGMwb+/vz9 +ffIilb///+yaCxNCwHGVC3gAAACU0lEQVR4nF2TQWvjMBBGVUGwj3WxaY/aAWNfi0zuwZPuHp0Q ob079OwYjHrsChb0s3dGctJ0ddTzm9F8lsR7WiNiWWL/flviul9Uh0NR4vY/gJUxJjOEtt/AubBy UsotRfH2DbxWE0hom3w5XJUEKis9hACt2hR4B86VDOtqTNHfgeEGvLiUN7Ddze26Dx6y1CUa+ygo NwFQm0N/BeMzCZAtNIoQrd9EhcH5mWpnztB8ZpJBlH23jaAbuE4EhZ2Bam0TeJ0DRMCKVP6CegWk q4z2TVFUx0946FOPcSe9ELE3rSHAj15rBuddS0C4BGyAutfpVAQkKdZOQiwMMIHxlUDrgeej5Ns7 I/ccSWNBLda1XwYBEG1Qswy1yXJf879nA4cjkNI0H+FzoUyuRodPA5eqZwFONG34i30ccOxeKFUy flNe1szqsgLdvXwKCj6zjTXODHV9M46gZPCLlYKCGTYO8S0aOAvJzRfD0w+1XcGIsxLUw/sYl5sM 9n0yjkoSUDOByrijwRRiAq13NhqLJYB3ACazrgN2bIwanyJQKXhHAJPRPQruEaCJP2Shy4DJ2As+ FQjJZH7AZIy6w0pQiiRYAh8nTEZHYDfRqSDeB5OXq4EEcAC4NocvoBl4+n1cyl54nyLRNA3iIwRP wNGFOK1g1Gz8jNfaCjdtqJLm2LXuqMc+50cDIJQpr6X0OHa4X58ULAw03QbRd7GUiG/K04mj0bNB xQhwJkEsJiZ1Bbgb6CnF79cBE+jwF91qniOCP3fghUFKxOShjIATw/wOfIQTg39LpFHtxhlKywAA AABJRU5ErkJggg== In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 15 Apr 2003 23:48:47 +0200") User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:51591 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:51591 On 15 apr 2003, larsi@gnus.org wrote: >Gaute B Strokkenes writes: > >>As luck would have it, the 10-colour version of the 9-colour image >>that I have in this image is precisely 739 bytes. When I base64 >>encode it I get a header that is too long. > >Oops. A miscalculation on my part. I calculated 33% + newlines, but >there needs to be a space on the beginning of each line as well. The >real limit is 726 bytes, and I've now updated the web page. That's execellent--but let's not forget the obvious patch to gnus-fun.el: Index: gnus-fun.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-fun.el,v retrieving revision 6.44 diff -u -r6.44 gnus-fun.el --- gnus-fun.el 16 Apr 2003 13:20:01 -0000 6.44 +++ gnus-fun.el 16 Apr 2003 17:10:36 -0000 @@ -115,7 +115,7 @@ (format gnus-convert-image-to-face-command (shell-quote-argument (expand-file-name file)) quant))) - (if (> (length attempt) 740) + (if (> (length attempt) 726) (progn (setq quant (- quant 2)) (message "Length %d; trying quant %d" @@ -155,10 +155,10 @@ (defun gnus-convert-png-to-face (file) "Convert FILE to a Face. FILE should be a PNG file that's 48x48 and smaller than or equal to -740 bytes." +726 bytes." (mm-with-unibyte-buffer (insert-file-contents file) - (when (> (buffer-size) 740) + (when (> (buffer-size) 726) (error "The file is %d bytes long, which is too long" (buffer-size))) (gnus-face-encode))) -- Big Gaute http://www.srcf.ucam.org/~gs234/ I decided to be JOHN TRAVOLTA instead!!