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: Sat, 24 Jul 2021 00:27:59 +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="7397"; 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 Sat Jul 24 01:29:10 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 1m74bN-0001g4-NB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jul 2021 01:29:10 +0200 Original-Received: from localhost ([::1]:38580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m74bL-0006WJ-Qd for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 19:29:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m74bG-0006WB-9p for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 19:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m74bF-0007L6-Te for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 19:29:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m74bF-0007of-RV for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 19:29: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: Fri, 23 Jul 2021 23:29: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.162708289229989 (code B ref 49688); Fri, 23 Jul 2021 23:29:01 +0000 Original-Received: (at 49688) by debbugs.gnu.org; 23 Jul 2021 23:28:12 +0000 Original-Received: from localhost ([127.0.0.1]:44923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m74aS-0007nd-Dw for submit@debbugs.gnu.org; Fri, 23 Jul 2021 19:28:12 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:56843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m74aQ-0007nQ-0G for 49688@debbugs.gnu.org; Fri, 23 Jul 2021 19:28:11 -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 7C533943; Fri, 23 Jul 2021 23:28:03 +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=1627082882; bh=pc3cO95m+fWsISDsiM8WqOxaSpbATdU6nhm+vupYM/0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eLXF8lnPzCmRjT4eeGqnAA7LDP/i452f40y7LxKHE4nAUXEDQx28jbF2kRSf5TVCH Vyk9AYqNAjYY48oTOLCdY7Pigmz+UVqNfwCaN9A8Rua13tG7TgYUwBVKjhEMbx/wXv A+nOkgXponOltzDxmgN4Ov9EODYXnoI0u7YAmsvX9+fm0yV6nXFuPLRcFAFLp80izT Ta/+5OimfBqfdNyKA8HCh21OK1Yl/dSeJMa34desvfGz0bscUpEvnJQ2xwoJngRYAY baO8GXEiAgS+IytKmb6LV9E9aYgWByhVhsJ7S7k1xJ+B5f1Ip5lQ4ZHHDtaTJkSrFF 6PHkYAjFYl9eA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1m74aF-00396F-Qj; Sat, 24 Jul 2021 00:27:59 +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:210618 Archived-At: On Sat, Jul 24, 2021 at 12:52:15AM +0200, Rudolf Adamkovič wrote: > I applied the patch using the “patch” command, and then I recompiled: > > ./configure --with-xwidgets --with-json --with-native-compilation > make > make install > > (Notice, no --without-native-image-api.) > > If what I did was correct, then the result is as follows: > > - Emacs does not crash. Good! > - The images have strange sizes. Oops! What about this instead: modified src/nsimage.m @@ -265,16 +265,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; } + imgRep = [[image representations] firstObject]; [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; [image setName:filename]; -- Alan Third