Hi,

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.

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to