From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#49688: 28.0.50; Attempting to show images crashes Emacs Date: Thu, 22 Jul 2021 23:11:22 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11705"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49688@debbugs.gnu.org To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 23 00:12:12 2021 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 1m6gvJ-0002pE-MZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 00:12:11 +0200 Original-Received: from localhost ([::1]:47224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6gvI-0001Yo-Jb for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Jul 2021 18:12:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6gvB-0001Yd-UV for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2021 18:12:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6gvB-0007Ju-NO for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2021 18:12:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6gvB-0005Xf-Ir for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2021 18:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jul 2021 22:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49688 X-GNU-PR-Package: emacs Original-Received: via spool by 49688-submit@debbugs.gnu.org id=B49688.162699189521266 (code B ref 49688); Thu, 22 Jul 2021 22:12:01 +0000 Original-Received: (at 49688) by debbugs.gnu.org; 22 Jul 2021 22:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:41765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6gul-0005Wv-Bp for submit@debbugs.gnu.org; Thu, 22 Jul 2021 18:11:35 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:50841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6gui-0005Wc-Cp for 49688@debbugs.gnu.org; Thu, 22 Jul 2021 18:11:33 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id B4DA41D8; Thu, 22 Jul 2021 22:11:25 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1626991885; bh=CNYz0RBKibz41zaRvKn2msJfZb7LarbI9fWw7fGaor8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WhwGUs23NFbmiNIIL/Wb1oMWFd8EnHUBzYCwiczoOdEy2EWd6uJntHPAqDYFzDw1P pqNAGseQvdbp8M0ZQx3wHf1RdMgjK/z0QME6N1Djj9LW1oPzzNk8x4bO5ahplsT+Wo 77yst5HQHCPE/WUHVbc8BpJtiD6BsaMxg/7xEoKzlV9UfPukDOlUQmqE/cxmIRAuo8 NgKu77HchZi6UAX2TF9OTyzGsQkYZPmA1JEfpvxR+dBH3lid11j4rC9jN864sInOg7 IH7p88/4nM0JpoZOdSGTmbKSrX/Ej1lV4sX+UP6Sw4L/HZNO9Te1ZhptwWvzy48WFk /zbY9k5XSlFeA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1m6guY-0038JR-98; Thu, 22 Jul 2021 23:11:22 +0100 Mail-Followup-To: Alan Third , Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , 49688@debbugs.gnu.org Content-Disposition: inline In-Reply-To: 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:210549 Archived-At: On Thu, Jul 22, 2021 at 11:01:19PM +0200, Rudolf Adamkovič wrote: > TWO CORRECTIONS: > > (1) I attached a wrong crash report. Please see the new attachment. I did wonder. ;) > (2) I *do* see album art now. (And Emacs does not crash.) Good. :) > I apologize for my mistakes. No problem. I can't see why this should fail. The code that's failing shouldn't be affected by anything we do, unless the images are invalid or something. Can you see if the following change makes any difference? modified src/nsimage.m @@ -251,7 +251,6 @@ @implementation EmacsImage + (instancetype)allocInitFromFile: (Lisp_Object)file { - NSImageRep *imgRep; Lisp_Object found; EmacsImage *image; NSString *filename; @@ -265,18 +264,12 @@ + (instancetype)allocInitFromFile: (Lisp_Object)file image = [[EmacsImage alloc] initByReferencingFile:filename]; image->bmRep = nil; -#ifdef NS_IMPL_COCOA - imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; -#else - imgRep = [image bestRepresentationForDevice: nil]; -#endif - if (imgRep == nil) + if (![image isValid]) { [image release]; return nil; } - [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; [image setName:filename]; return image; -- Alan Third