# HG changeset patch # User Adrian Robert # Date 1232558885 0 # Node ID 06994fb0863f735545cffcc26536ef9187595eda # Parent 88cb3b251e876c7eb2de34040a436f0e5aedeb2a * nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. (Bug#1316) diff -r 88cb3b251e87 -r 06994fb0863f src/ChangeLog --- a/src/ChangeLog Wed Jan 21 17:09:28 2009 +0000 +++ b/src/ChangeLog Wed Jan 21 17:28:05 2009 +0000 @@ -1,12 +1,16 @@ 2009-01-21 Adrian Robert * nsmenu.m (NSMENUPROFILE): Change #if style. + * nsterm.m: (x_set_frame_alpha): Add prototype. (ns_fake_keydown, EmacsView-keyUp:): New variable and function to handle Ctrl-tab. (Bug#1841) (ns_get_color): Use unsigned long long for scanned hex string value. (ns_term_shutdown): Abort on non SIGTERM signals. + * nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. + (Bug#1316) + 2009-01-19 Chong Yidong * xfaces.c (Finternal_set_lisp_face_attribute, Fx_list_fonts): diff -r 88cb3b251e87 -r 06994fb0863f src/nsimage.m --- a/src/nsimage.m Wed Jan 21 17:09:28 2009 +0000 +++ b/src/nsimage.m Wed Jan 21 17:28:05 2009 +0000 @@ -163,6 +163,7 @@ + allocInitFromFile: (Lisp_Object)file { EmacsImage *image = ImageList; + NSImageRep *imgRep; Lisp_Object found; /* look for an existing image of the same name */ @@ -185,12 +186,18 @@ image = [[EmacsImage alloc] initByReferencingFile: [NSString stringWithUTF8String: SDATA (found)]]; - if ([image bestRepresentationForDevice: nil] == nil) + imgRep = [image bestRepresentationForDevice: nil]; + if (imgRep == nil) { [image release]; return nil; } + /* The next two lines cause the DPI of the image to be ignored. + This seems to be the behavior users expect. */ + [image setScalesWhenResized: YES]; + [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; + [image setName: [NSString stringWithUTF8String: SDATA (file)]]; [image reference]; ImageList = [image imageListSetNext: ImageList];