kif-framework / Lela

Lela iOS Perceptual Difference Testing Framework
GNU General Public License v3.0
73 stars 15 forks source link

imageWithContentsOfFile can't find the filepath error - expectScreenToMatchImageNamed #13

Closed UXDart closed 9 years ago

UXDart commented 9 years ago

Hello. For some reason [imageWithContentsOfFile:] doesn't find the path file image, but using NSData it works, is anyone else having this problem? is anyone using Lela? :)

+ (UIImage *)expectedImageWithName:(NSString *)name
{
    NSString *fileName = [[self imageNameForScreenNamed:name] stringByAppendingPathExtension:@"png"];
    NSString *filePath = [[self directoryForExpectedImages] stringByAppendingPathComponent:fileName];
    NSData *data = [NSData dataWithContentsOfFile:filePath]; //I changed these next 2 lines
    return [UIImage imageWithData:data];
}

can you change it? I'm using cocoapods!

note: using iOS 8.3 with ipad 2 simulator

TIA!

UXDart commented 9 years ago

oh... I saw it is fixed in the latest branch, can you push it to cocoapods? Thanks!

phatmann commented 9 years ago

Pushed!

UXDart commented 9 years ago

Thanks!!