prine/ROThumbnailGenerator

Capitalized extensions

Closed this issue · 2 comments

Hello. Cool library, but I believe there is one problem with it. My app crashed when I wanted to get thumbnail of file with name IMG_0007.JPG. I think that the problem is uppercase file extension, because when I changed ROThumbnail.sharedInstance.getThumbnail method with following code it worked:

    public func getThumbnail(url:NSURL) -> UIImage {
        if let fileExtension = url.pathExtension {
            var smallExt = fileExtension.lowercaseString
            var appropriateThumbnailGenerator = supportedFiletypes[smallExt] ?? DefaultThumbnailGenerator()
            return appropriateThumbnailGenerator.getThumbnail(url)
        }

        return UIImage(named:"fallbackIcon")!
    }
prine commented

Ah good catch! Will fix it in the next release. Thanks!

prine commented

Fixed in Commit a9de6a8