Page 2 of 2

Re: Ignore icon DPI

Posted: Fri Jun 20, 2008 9:08 pm
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 ;-)

Re: Ignore icon DPI

Posted: Fri Jun 20, 2008 9:21 pm
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.

Re: Ignore icon DPI

Posted: Fri Jun 20, 2008 9:27 pm
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

Re: Ignore icon DPI

Posted: Fri Jun 20, 2008 9:29 pm
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.