ios - UIImageJPEGRepresentation如何优化性能?
ringa_lee
ringa_lee 2017-04-17 14:19:52
0
1
748

如题,代码如下:
NSData *fData = UIImageJPEGRepresentation(photo, 1.0);

本来单个也占不了多大的内存。但是我要做的是批量图片上传。
就单这行代码,内存急剧上升,处理几十张图片,就从几十升到几百MB了。
那么请问如何解决这个问题呢?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
阿神

1) Control the Buff threshold when reading into memory, split the task and do more IO several times...
2) Dedicated background thread processing tasks

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!