[問題] UIImageJPEGRepresentation 效能
大家好,我想把圖存進app的沙箱裡,程式碼如下
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
Stopwatch *watch = [[Stopwatch alloc]initWithName:@"counter"];
[watch start];
[UIImageJPEGRepresentation(image,(TempImageFileQuality)) writeToFile:path atomically:YES];
[watch stop];
[watch statistics];
[watch release];
});
目前在TempImageFileQuality=0.8(JPEG 壓縮率,愈小代表品質愈差)
counter finished in 3.531925 seconds.
counter finished in 1.911194 seconds.
counter finished in 1.865129 seconds.
counter finished in 3.815366 seconds.
counter finished in 1.887425 seconds.
在不降低 TempImageFileQuality 情況下,能不能增加存圖的效能?
希望至少能一秒一張。 謝謝各位。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.163.14.75
※ 編輯: s8911124 來自: 118.163.14.75 (04/01 18:07)
推
04/01 18:45, , 1F
04/01 18:45, 1F
→
04/01 18:47, , 2F
04/01 18:47, 2F
→
04/03 12:11, , 3F
04/03 12:11, 3F