[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSUseFreedesktopThumbnails is not working correctly

From: Fred Kiefer
Subject: Re: GSUseFreedesktopThumbnails is not working correctly
Date: Fri, 26 Aug 2011 09:35:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv: Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

On 25.08.2011 17:22, Riccardo Mottola wrote:

Unfortunately, image is never nil. If no thumbnail file exists, an
NSImage object is returned which contains no representations (check
class NSBitmapImageRep, +imageRepsWithData:). Hence, no image is
displayed, not even the one for unknown file types.

Perhaps this has to do with multiple representations: imageRepWithData
returns NIL imageRepsWithData returns an empty array.

initWithContentsOfFile says though:

(from Cocoa Docs)

Return Value

An initialized NSImage instance, or nil if the method cannot create an
image representation from the contents of the specified file.

I think the culprit is _loadFromFile: it checks that the array is not
nil, instead it should check that the array is not empty.

I patched that, I dont't seem to have caused havoc elsewhere, please try
if it solves your problem.

Thank you for looking into this problem. I think your solution was slightly off as it was using "or" instead of "and" but it helped me fix the problem quickly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]