On 25/02/2009, at 4:04 PM, [email protected] wrote:


Hi Graham,

I tried what you have suggested still only images are shown with titles.


I'm not clear what the problem is - what did you expect to see?

- (NSString*)   imageSubtitle
{
        NSDictionary* attribs = [image imageAttributes];

        int w, h;

        w = [[attribs objectForKey:@"PixelWidth"] intValue];
        h = [[attribs objectForKey:@"PixelHeight"] intValue];

return [NSString stringWithFormat:@"%d x %d", w, h];
}


This won't work - NSImage doesn't have a method called - imageAttributes. In my code the attributes are retrieved using [self imageAttributes], and that method looks like this:

- (NSDictionary*)       imageAttributes
{
// returns the image's attributes dictionary using CGImageSource to read the file's header. This is fast as the image
        // itself isn't loaded.
        
        NSURL*            url = [NSURL fileURLWithPath:mPath];
CGImageSourceRef srcRef = CGImageSourceCreateWithURL((CFURLRef) url, NULL ); NSDictionary* imgProps = (NSDictionary*) CGImageSourceCopyPropertiesAtIndex( srcRef, 0, NULL);
        
        CFRelease(srcRef);
        
        //NSLog(@"attributes for '%@': %@", mPath, imgProps );
        
        return [imgProps autorelease];
}


I suspect your method is asserting when it's called due to the unimplemented method and that is stopping the browser view working properly. Check your console output.



--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to