From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#39735: 27.0.60; bugs about XBM images Date: Sun, 02 Aug 2020 10:38:53 +0200 Message-ID: <875za1mogy.fsf@gnus.org> References: <86mu9apvc7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 39735@debbugs.gnu.org To: ynyaaa@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 02 10:40:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k29XO-0000Si-Hb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 10:40:10 +0200 Original-Received: from localhost ([::1]:33206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k29XN-0007Xa-0o for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 04:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k29XG-0007XH-Pj for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 04:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k29XG-0000UY-FP for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 04:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k29XG-0000IL-Aj for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 04:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Aug 2020 08:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39735 X-GNU-PR-Package: emacs Original-Received: via spool by 39735-submit@debbugs.gnu.org id=B39735.15963575471065 (code B ref 39735); Sun, 02 Aug 2020 08:40:02 +0000 Original-Received: (at 39735) by debbugs.gnu.org; 2 Aug 2020 08:39:07 +0000 Original-Received: from localhost ([127.0.0.1]:41649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k29WN-0000H7-22 for submit@debbugs.gnu.org; Sun, 02 Aug 2020 04:39:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:59210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k29WK-0000Gc-Ol for 39735@debbugs.gnu.org; Sun, 02 Aug 2020 04:39:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Slt4TARuJRqEG9T+SKAoiniZAzeYhVYBoPCtharT/to=; b=b+al+viq2nVAoTAikHpp8EEPB6 ETLEWSogFMChxAaA1ISHvgEGiJGXCA+T/cAQyhiK6e0NcjjKpuvweASXXUnCx62MH0uK3xnqCsa2B h2CS1LsqZmerQLQngYLT4e9bIR+UO7uBH1Evo4bTQ5yx3VLAlFGPV1CmwQACKrWbpsQA=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k29WB-0007AQ-32; Sun, 02 Aug 2020 10:38:57 +0200 In-Reply-To: <86mu9apvc7.fsf@gmail.com> (ynyaaa@gmail.com's message of "Sat, 22 Feb 2020 23:09:28 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183819 Archived-At: ynyaaa@gmail.com writes: > (1)XBM image with :file property can not be scaled with :width or :height. > > (let ((f (locate-file "gnus/preview.xbm" image-load-path))) > (image-size (create-image f 'xbm nil :width 128))) > error-> Invalid image specification > > (2)XBM image with :data property has no way to scale with different > aspect ratio. > > :width and :height image properties are interpreted as adittional > properties on :data property. I think these are probably somewhat connected: :width and :height have a special meaning for some XBM images: If the specification is for a bitmap loaded from memory it must contain `:width WIDTH', `:height HEIGHT', and `:data DATA', where WIDTH and HEIGHT are integers > 0. DATA may be: So the Emacs XBM functions uses :width and :height so specify the dimensions of the data, not how big the image is going to turn out to be displayed. It's unfortunate that we're using the same properties for two different things. I'm not sure how to fix that. XBM images aren't used much, I would imagine... Eli, would it make sense to do a backwards-incompatible change here and rename the XBM parameters to :xbm-width and :xbm-height? > (3)XBM :data string can not be used as raw bit pattern > if it looks like contents of XBM file, > > (let ((data "\ > #define b_width 1 > #define b_height 1 > static char b[] = {0x01} > ")) > (image-size > (create-image data 'xbm t :width 8 :height (length data)))) > error-> Invalid image specification This is more of the same: It's the overloading of :width/:height, which means that we don't allow those parameters for data like that: DATA may be: 1. a string large enough to hold the bitmap data, i.e. it must have a size >= (WIDTH + 7) / 8 * HEIGHT 2. a bool-vector of size >= WIDTH * HEIGHT 3. a vector of strings or bool-vectors, one for each line of the bitmap. 4. a string containing an in-memory XBM file. WIDTH and HEIGHT may not be specified in this case because they are defined in the XBM file. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no