NSString *input = [[NSBundle mainBundle] pathForResource:@"meme" ofType:@"gif"];
NSString *dirtail = [NSString stringWithFormat:@"%@",@"/Documents/Images"];
NSString *dirfull = [NSHomeDirectory() stringByAppendingPathComponent:dirtail];
if (![[NSFileManager defaultManager] fileExistsAtPath:dirfull]) {
[[NSFileManager defaultManager] createDirectoryAtPath:dirfull withIntermediateDirectories:YES attributes:nil error:nil];
}
NSString *outpath = [[dirfull stringByAppendingPathComponent:@"meme2"] stringByAppendingPathExtension:@"gif"];
NSLog(@"out path :%@",outpath);
GIFCompressionResult re = [GIFCompression compressGIFWithLossyLevel:80 inputPath:input outputPath:outpath];
NSLog(@"end result : %d",(long)re);
levinxiao / giflossycompress Goto Github PK
View Code? Open in Web Editor NEWA GIF lossy compress iOS framework 一个简单易用的gif有损压缩库