From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Roberts Newsgroups: gmane.emacs.bugs Subject: XBM images sometimes inverted on Windows Date: Fri, 30 Nov 2007 12:42:26 +0000 Message-ID: <20071130124226.GA28554@janet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196497050 30527 80.91.229.12 (1 Dec 2007 08:17:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 08:17:30 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 01 09:17:40 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyNXd-0007RL-7O for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2007 09:17:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyNXN-0001F2-0N for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2007 03:17:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iy5CR-0006vl-FG for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2007 07:42:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iy5CP-0006u7-Jm for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2007 07:42:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iy5CP-0006u3-GT for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2007 07:42:29 -0500 Original-Received: from venus.karoo.kcom.com ([212.50.160.60] helo=venus.eclipse.kcom.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iy5CP-0006G9-6g for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2007 07:42:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAM6NT0dbVDw7/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.23,234,1194220800"; d="scan'208";a="180719496" Original-Received: from unknown (HELO localhost) ([91.84.60.59]) by venus.eclipse.kcom.com with ESMTP; 30 Nov 2007 12:42:27 +0000 Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Sat, 01 Dec 2007 03:14:54 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17100 Archived-At: Hi, I've noticed that when running Emacs under Windows, if you create an XBM image where the :data keyword is set to a string containing the actual bits of the bitmap then the foreground and background colours are swapped. If you use the same image but set the :data keyword to an XBM image string then the swapping does not occur. The swapping doesn't occur either way under X. Is this a bug? Please eval the following code snippet to demonstrate. Under X, both smilies look the same, but under Windows the bottom smiley is white-on-black, and the top smiley is black-on-white. (defconst smiley-data '(#x00 #x00 #x24 #x00 #x00 #x24 #x18 #x00)) (defun smiley-from-xbm-data () ;; Make an XBM image from the smiley data (list 'image :type 'xbm :ascent 100 :data (concat "#define smiley_width 8\n" "#define smiley_height 8\n" "static unsigned char smiley_bits[] = {\n" " " (mapconcat (lambda (byte) (format "0x%02x" byte)) smiley-data ", ") " };"))) (defun smiley-from-xbm-bytes () ;; Make an image using the bytes directly in a string (list 'image :type 'xbm :ascent 100 :width 8 :height 8 :data (apply 'string smiley-data))) (save-excursion (set-buffer (get-buffer-create "*Smiley demo*")) (erase-buffer) (insert "Smiley created from XBM image: " (propertize ":)" 'display (smiley-from-xbm-data)) "\n" "Smiley created from the actual bytes: " (propertize ":)" 'display (smiley-from-xbm-bytes)) "\n") (pop-to-buffer (current-buffer))) Thanks, - Neil