Worked around this issue by writing a quick-and-dirty recursive file re-saver. I've verified that simply running this against my project directory fixes the 459 errors I was seeing. Here's the pertinent code in case it helps anyone.
- (IBAction) btnGo_Pressed:(id) sender {
// The path to search is specified by the user
NSString *path = self.txtPathToSearch.stringValue;
// Recursively find all files within it
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *subpaths = [fileManager subpathsOfDirectoryAtPath:path error:nil];
// Look for pngs
int totalImagesResaved = 0;
for (int j=0; j<[subpaths count]; j++) {
NSString *fullPath = [path stringByAppendingPathComponent:[subpaths objectAtIndex:j]];
// See if this path ends with a ".png"
if ([fullPath compare:@".png" options:NSCaseInsensitiveSearch range:NSMakeRange([fullPath length] - 4, 4)] == NSOrderedSame) {
// Got one. Now resave it as a png
NSImage *image = [[NSImage alloc] initWithContentsOfFile:fullPath];
[self saveImage:image asPngWithPath:fullPath];
totalImagesResaved++;
}
}
// Status report
NSAlert *alert = [NSAlert alertWithMessageText:@"Done" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Encountened %li paths. Resaved %i .pngs.", (unsigned long)[subpaths count], totalImagesResaved];
[alert runModal];
}
- (void) saveImage:(NSImage *) image asPngWithPath:(NSString *) path
{
// Cache the reduced image
NSData *imageData = [image TIFFRepresentation];
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData];
imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
[imageData writeToFile:path atomically:YES];
}