[問題] UIImageJPEGRepresentation 效能

看板MacDev作者 (-.-)時間11年前 (2013/04/01 18:06), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
大家好,我想把圖存進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
等 iPhone6 出來應該有希望
04/01 18:45, 1F

04/01 18:47, , 2F
不然就試試 ImageIO 吧
04/01 18:47, 2F

04/03 12:11, , 3F
Thanks
04/03 12:11, 3F
文章代碼(AID): #1HMLmFpS (MacDev)