From: Alan Third <alan@idiocy.org>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: 49688@debbugs.gnu.org
Subject: bug#49688: 28.0.50; Attempting to show images crashes Emacs
Date: Sat, 24 Jul 2021 00:27:59 +0100 [thread overview]
Message-ID: <YPtQf+Tv/PE95VTC@idiocy.org> (raw)
In-Reply-To: <m2a6mcd4o0.fsf@me.com>
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
next prev parent reply other threads:[~2021-07-23 23:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 22:34 bug#49688: 28.0.50; Attempting to show images crashes Emacs Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-22 7:52 ` Alan Third
2021-07-22 10:33 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-22 19:50 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-22 21:01 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-22 22:11 ` Alan Third
2021-07-23 22:52 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-23 23:27 ` Alan Third [this message]
2021-07-24 16:09 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-24 16:52 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-24 17:05 ` Alan Third
2021-07-24 22:44 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-24 23:22 ` Alan Third
2021-07-25 23:45 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-26 20:05 ` Alan Third
2021-10-20 15:22 ` Stefan Kangas
2021-10-20 20:13 ` Alan Third
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YPtQf+Tv/PE95VTC@idiocy.org \
--to=alan@idiocy.org \
--cc=49688@debbugs.gnu.org \
--cc=salutis@me.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).