unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Thu, 22 Jul 2021 23:11:22 +0100	[thread overview]
Message-ID: <YPntClMewP2vq1+5@idiocy.org> (raw)
In-Reply-To: <m2r1fqrrkw.fsf@me.com>

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





  reply	other threads:[~2021-07-22 22:11 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 [this message]
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
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=YPntClMewP2vq1+5@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).