From: Gaute B Strokkenes <gs234@cam.ac.uk>
Subject: Re: Coloured faces: 740 bytes is too much.
Date: Fri, 18 Apr 2003 00:05:20 +0100 [thread overview]
Message-ID: <87istcybbj.fsf@cam.ac.uk> (raw)
In-Reply-To: <m365pfv3cw.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Tue, 15 Apr 2003 23:48:47 +0200")
On 15 apr 2003, larsi@gnus.org wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> 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!!
prev parent reply other threads:[~2003-04-17 23:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-13 13:48 Gaute B Strokkenes
2003-04-15 21:48 ` Lars Magne Ingebrigtsen
2003-04-17 23:05 ` Gaute B Strokkenes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87istcybbj.fsf@cam.ac.uk \
--to=gs234@cam.ac.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).