+2003-01-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-ignored-headers): Added Face.
+
2003-01-10 Simon Josefsson <jas@extundo.com>
* nndraft.el (nndraft-request-group): Avoid crash in
"^X-Request-PGP:" "^X-Fingerprint:" "^X-WRIEnvto:" "^X-WRIEnvfrom:"
"^X-Virus-Scanned:" "^X-Delivery-Agent:" "^Posted-Date:" "^X-Gateway:"
"^X-Local-Origin:" "^X-Local-Destination:" "^X-UserInfo1:"
- "^X-Received-Date:" "^X-Hashcash:")
+ "^X-Received-Date:" "^X-Hashcash:" "^Face:")
"*All headers that start with this regexp will be hidden.
This variable can also be a list of regexps of headers to be ignored.
If `gnus-visible-headers' is non-nil, this variable will be ignored."
:group 'gnus-fun
:type 'string)
+(defcustom gnus-convert-image-to-face-command "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng"
+ "Command for converting a GIF to an X-Face."
+ :group 'gnus-fun
+ :type 'string)
+
(defun gnus-shell-command-to-string (command)
"Like `shell-command-to-string' except not mingling ERROR."
(with-output-to-string
(format gnus-convert-image-to-x-face-command
(shell-quote-argument file)))))
+(defun gnus-face-from-file (file)
+ "Return an Face header based on an image file."
+ (interactive "fImage file name:" )
+ (when (file-exists-p file)
+ (let ((done nil)
+ (attempt "")
+ (quant 4))
+ (while (and (not done)
+ (> quant 1))
+ (setq attempt
+ (gnus-shell-command-to-string
+ (format gnus-convert-image-to-face-command
+ (shell-quote-argument file)
+ quant)))
+ (if (> (length attempt) 740)
+ (setq quant (/ quant 2))
+ (setq done t)))
+ (if done
+ (mm-with-unibyte-buffer
+ (insert attempt)
+ (base64-encode-region (point-min) (point-max))
+ (goto-char (point-min))
+ (forward-line 1)
+ (while (not (eobp))
+ (insert " ")
+ (forward-line 1))
+ (buffer-string))
+ nil))))
+
(defun gnus-convert-image-to-gray-x-face (file depth)
(let* ((mapfile (mm-make-temp-file (expand-file-name "gnus."
mm-tmp-directory)))