Skip to content
This repository
Browse code

Image loading (NS): respect DPI. Provide high-resolution version of l…

…ogo.

aquamacs-fancy-splash-screen.jpg now named aquamacs-logo.tiff

Conflicts:

	src/nsimage.m
  • Loading branch information...
commit 8331e6795444bee1f741a706f370a15b70d2709e 1 parent db6ed87
David Reitter authored
2  Makefile.in
@@ -456,7 +456,7 @@ install-aquamacs: mkdir
456 456 (cd $(ns_appresdir)/etc/images && find . -name '*.svg' -delete ; cd -) ; \
457 457 (cp $(AQUAMACS_DIR)/src/site-lisp/tabbar/*.png $(ns_appresdir)/etc/images/ && \
458 458 rm $(ns_appresdir)/lisp/aquamacs/tabbar/*.png) ; \
459   - cp $(AQUAMACS_DIR)/src/etc/aquamacs-splash-screen.jpg $(ns_appresdir)/etc/images/ ; \
  459 + cp $(AQUAMACS_DIR)/src/etc/aquamacs-logo.tiff $(ns_appresdir)/etc/images/ ; \
460 460 rm -r "$(ns_appresdir)/Aquamacs Help" 2>/dev/null ; \
461 461 cp -r $(AQUAMACS_DIR)"/doc/Aquamacs Help" "$(ns_appresdir)/Aquamacs Help" ; \
462 462 (cd $(ns_appresdir)/leim ; rm quail/*.el quail/*.el.gz ja-dic/*.el ja-dic/*.el.gz ; cd -) ; \
415 aquamacs/src/etc/Aquamacs-logo.svg
415 additions, 0 deletions not shown
BIN  aquamacs/src/etc/aquamacs-logo.png
BIN  aquamacs/src/etc/aquamacs-logo.tiff
Binary file not shown
BIN  aquamacs/src/etc/aquamacs-logo@2x.png
BIN  aquamacs/src/etc/aquamacs-splash-screen.jpg
2  aquamacs/src/site-lisp/aquamacs.el
@@ -1345,7 +1345,7 @@ to the selected frame."
1345 1345 (require 'savehist) ;; because we configure and activate it
1346 1346
1347 1347 (aquamacs-set-defaults
1348   - '((fancy-splash-image "aquamacs-splash-screen.jpg")
  1348 + '((fancy-splash-image "aquamacs-logo.tiff")
1349 1349 (fancy-splash-max-time 3000)))
1350 1350
1351 1351 ;; while pc selection mode will be turned on, we don't
17 src/nsimage.m
@@ -204,17 +204,30 @@ @implementation EmacsImage
204 204 image = [[EmacsImage alloc] initByReferencingFile:
205 205 [NSString stringWithUTF8String: SDATA (found)]];
206 206
  207 + // image = [NSImage imageNamed: [NSString stringWithUTF8String: SDATA (found)]];
  208 +
  209 +
  210 +#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
  211 + imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
  212 +#else
207 213 imgRep = [image bestRepresentationForDevice: nil];
  214 +#endif
208 215 if (imgRep == nil)
209 216 {
210 217 [image release];
211 218 return nil;
212 219 }
213 220
  221 + /* Do not ignore the DPI of the image - in case of multiple representations
  222 + (e.g., TIFFs with images for multiple resolutions), retain image size and
  223 + let NSImage choose the right representation. */
  224 +
214 225 /* The next two lines cause the DPI of the image to be ignored.
215 226 This seems to be the behavior users expect. */
216   - [image setScalesWhenResized: YES];
217   - [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
  227 + // [image setScalesWhenResized: YES];
  228 + // [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
  229 + // this would retain the size:
  230 + // [image setSize: NSMakeSize([image size].width, [image size].height)];
218 231
219 232 [image setName: [NSString stringWithUTF8String: SDATA (file)]];
220 233 [image reference];

0 comments on commit 8331e67

Please sign in to comment.
Something went wrong with that request. Please try again.