(gnus-fun-ppm-change-string): New function.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Mar 2003 01:13:13 +0000 (01:13 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 30 Mar 2003 01:13:13 +0000 (01:13 +0000)
(gnus-grab-cam-face): Use it.

lisp/ChangeLog
lisp/gnus-fun.el

index 7ea81c6..9b08376 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-fun.el (gnus-fun-ppm-change-string): New function.
+       (gnus-grab-cam-face): Use it.
+
 2003-03-28  Paul Jarc  <prj@po.cwru.edu>
 
        * nnmaildir.el (nnmaildir-request-set-mark,
index 9fcb839..04df9da 100644 (file)
@@ -222,12 +222,25 @@ colors of the displayed X-Faces."
      (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>/dev/null | ppmnorm | ppmtopgm | pnmscale -width 48 -height 48 > /tmp/gnus.face.ppm"
             file))
     (let ((gnus-convert-image-to-face-command
-          "cat '%s' | ppmquant %d | pnmtopng"))
+          (format "cat '%%s' | ppmchange %s | ppmquant %%d | pnmtopng"
+                  (gnus-fun-ppm-change-string))))
       (setq result (gnus-face-from-file "/tmp/gnus.face.ppm")))
     (delete-file file)
     ;;(delete-file "/tmp/gnus.face.ppm")
     result))
 
+(defun gnus-fun-ppm-change-string ()
+  (let* ((possibilites '("%02x0000" "00%02x00" "0000%02x"
+                       "%02x%02x00" "00%02x%02x" "%02x00%02x"))
+        (format (concat "'#%02x%02x%02x' '#"
+                        (nth (random 6) possibilites)
+                        "'"))
+        (values nil))
+  (dotimes (i 255)
+    (push (format format i i i i i i)
+         values))
+  (mapconcat 'identity values " ")))
+
 (provide 'gnus-fun)
 
 ;;; gnus-fun.el ends here