Ignore icon DPI

The Growl forums have moved to Google Groups, this forum is read only.
Wooden Brain Concepts
Latté
Posts: 50
Joined: Wed Dec 27, 2006 2:37 am

Re: Ignore icon DPI

Post by Wooden Brain Concepts »

Sorry, I have a different philosophy. For small little details like this you are unlikely to return to any time soon, just help a brother out.

I do appreciate you making me kick and scream to do this, I did learn something. But it was so far from a priority it was really driving me quite nuts.

Edit: regarding claims to proof: I was going so nuts over this I was pretty convinced you just resized it in a graphics program first just to mess with me ;-)
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: Ignore icon DPI

Post by boredzo »

Wooden Brain Concepts wrote:For small little details like this you are unlikely to return to any time soon, just help a brother out.
Well, OK. Here you go:

Code: Select all

NSImage *myImage = [NSImage alloc]; 
myImage = [myImage initWithContentsOfFile:aPath];  
NSBitmapImageRep *rep = [myImage bestRepresentationForDevice: nil];
NSSize newSize = { [rep pixelsWide], [rep pixelsHigh] };
[rep setSize: newSize];

	NSData *JPEGData = [NSBitmapImageRep representationOfImageRepsInArray:[NSArray arrayWithObject:rep] 
				usingType:NSJPEGFileType 
            properties:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.0] 
                                                   forKey:NSImageCompressionFactor]];
	
	[GrowlApplicationBridge notifyWithTitle:atitle
	description:amsg
	notificationName:anotif
	iconData:JPEGData
	priority:aPrior
	isSticky:aStick
	clickContext:aClick];
	
NSString *JPEGPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"SavedGrowlIcon.jpg"];
[JPEGData writeToFile:JPEGPath atomically:NO];
[[NSWorkspace sharedWorkspace] selectFile:JPEGPath inFileViewerRootedAtPath:@""];
	
	[myImage release];
I am curious as to how this differs from your own code that you suggest still doesn't work.
Wooden Brain Concepts
Latté
Posts: 50
Joined: Wed Dec 27, 2006 2:37 am

Re: Ignore icon DPI

Post by Wooden Brain Concepts »

um thanks... did you see my edit above? i had already got that before you even posted your last reply!

Again thanks.

After I clean up my sample project for applescript I will post in a new thread -- to put into practice my philosophy. ;-)

edit: and i will not make the sticky the default haha
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: Ignore icon DPI

Post by boredzo »

Wooden Brain Concepts wrote:um thanks... did you see my edit above? i had already got that before you even posted your last reply!
I didn't, actually. I'm glad you got it working. ☺
Again thanks.
You're welcome.
Locked