-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
选择了原图,图片压缩问题——不会直接返回原图 #427
Comments
同上,设置photoWidth大于828,好像也不起作用!最后只能自己去取原图,但不知道会不会有问题?
|
跟一下源码,好像isSelectOriginalPhoto就是传真属性,后续操作,要我们自己写! |
你好,请参考这个issue:#457 |
您好!请问 [[TZImageManager manager] getOriginalPhotoWithAsset:assets.firstObject completion:^(UIImage *photo, NSDictionary *info) { |
@jiangsihao 因为你做了一次PNG无损压缩,试试用UIImageJPEGRepresentation来压缩,数据应该就比较正常了 |
[[TZImageManager manager] getOriginalPhotoWithAsset:assets.firstObject completion:^(UIImage *photo, NSDictionary *info) {
NSData *data = UIImagePNGRepresentation(photo);
NSData *imageData = UIImageJPEGRepresentation(photo, 1.0);
}]; 上面确实是有问题,如果直接用系统的处理是正常的 [[PHImageManager defaultManager] requestImageDataForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
float mSize = imageData.length/1024.00/1024.00; // 单位MB ,这个才正常
}]; |
@fryindancy 恩, |
我选择照片的时候 选中了原图 大小为2.1MB 但是通过UIImageJPEGRepresentation 获取原图以后 发现照片大小有5.9MB 很费解。。。 为什么上面标识的原图大小不真实。。。 |
@jiangsihao 用UIImageJPEGRepresentation得到5.9,你传的质量系数是1.0吧...你系数变得到的图片大小就在变。 显示的2.1M,是通过下面这个系统方法获取的 [[PHImageManager defaultManager] requestImageDataForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
float mSize = imageData.length/1024.00/1024.00;
}]; 上面也提到过,如果要获取2.1M的UIImage对象,用 |
解决了 谢谢 |
选择【原图】和不选择原图上传的图片是一样的,而且选择的图片大小有2M。是不是【原图】按钮没起作用?
The text was updated successfully, but these errors were encountered: