又他妈的是 文件名 一样,一条指令的 时间,
-(void)writeJPGToFile:(IMMessageInfo *)imMessageInfo
{
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imMessageInfo.pic_thumbnail_networkPath]];
UIImage *mImage = [UIImage imageWithData:imageData];
mImage = [mImage imageByScalingToDefaultWidth:100.0];
mImage = [mImage imageByScalingToDefaultSizeAccordingToHeight:100.0];
imageData = UIImageJPEGRepresentation(mImage, 1);
NSString *fileName = [NSString stringWithFormat:@"%.0f",imMessageInfo.messageId];
NSString *localFilePath = [ChatVoiceRecorderVC getPathByFileName:fileName ofType:@"jpg"];
[imageData writeToFile:localFilePath atomically:NO];
imMessageInfo.pic_thumbnail_localPath = localFilePath;
imMessageInfo.pic_width = mImage.size.width;
imMessageInfo.pic_height = mImage.size.height;
}