[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/ns/refactor 0132e0a 12/12: Fix image crash on macOS (bug#49688)
From: |
Alan Third |
Subject: |
scratch/ns/refactor 0132e0a 12/12: Fix image crash on macOS (bug#49688) |
Date: |
Sat, 24 Jul 2021 11:40:05 -0400 (EDT) |
branch: scratch/ns/refactor
commit 0132e0a1a9365cb99b9bee24607356884bb8648e
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Fix image crash on macOS (bug#49688)
* src/nsimage.m ([EmacsImage allocInitFromFile:]): Use isValid to
check whether the image is valid instead of generating a tiff.
---
src/nsimage.m | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/nsimage.m b/src/nsimage.m
index bd01a51..dd2bb3b 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -265,16 +265,12 @@ ns_image_size_in_bytes (void *img)
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];
- branch scratch/ns/refactor created (now 0132e0a), Alan Third, 2021/07/24
- scratch/ns/refactor db055f9 01/12: Simplify macOS drawing code, Alan Third, 2021/07/24
- scratch/ns/refactor 361d043 11/12: Convert fringe bitmaps to vectors on NS port, Alan Third, 2021/07/24
- scratch/ns/refactor 7b255dc 07/12: Fix some macOS problems, Alan Third, 2021/07/24
- scratch/ns/refactor dee3be7 08/12: * src/nsterm.m (ns_set_frame_alpha): Enable alpha on GNUstep., Alan Third, 2021/07/24
- scratch/ns/refactor d9fd86c2 02/12: Tidy up NS port OS window handling, Alan Third, 2021/07/24
- scratch/ns/refactor 94b4470 06/12: Move parent frame setting code into EmacsWindow, Alan Third, 2021/07/24
- scratch/ns/refactor 8d0fb51 04/12: Fix macOS live resize drawing, Alan Third, 2021/07/24
- scratch/ns/refactor df9a612 03/12: Change NS port resize detection, Alan Third, 2021/07/24
- scratch/ns/refactor 0132e0a 12/12: Fix image crash on macOS (bug#49688),
Alan Third <=
- scratch/ns/refactor 93b18cc 09/12: Simplify NS sizing and positioning code, Alan Third, 2021/07/24
- scratch/ns/refactor 6f4f66d 05/12: Move NS port toolbar handling to the window, Alan Third, 2021/07/24
- scratch/ns/refactor 8d34954 10/12: Fix NS inset rectangle corners, Alan Third, 2021/07/24