我試圖找到一種方法來讀取和寫入JPEG圖像到用戶庫(相機膠捲),而無需iOS重新壓縮它們。 UIImage似乎是這裏的瓶頸。保存到用戶庫的唯一方法是我找到的是UIImageWriteToSavedPhotosAlbum()。有沒有解決的辦法?保存爲/從用戶庫中獲取JPEG而無需重新壓縮
現在我的日常看起來像這樣
-Ask的UIImagePickerController相片。而當它didFinishPickingMediaWithInfo,這樣做:
NSData *imgdata = [NSData dataWithData:UIImageJPEGRepresentation([info objectForKey:@"UIImagePickerControllerOriginalImage"], 1)];
[imgdata writeToFile:filePath atomically:NO];
-Process JPEG無損磁盤上。
- 然後將其重新保存:
UIImageWriteToSavedPhotosAlbum([UIImage imageWithContentsOfFile:[self getImagePath]], self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
這是什麼質量的降低看起來像3次後,一個小動畫:
它每次我這樣做的時候明顯惡化,但我無法自動完成圖像採集部分,以便對其進行50/100/1000週期的全面測試。
是的,謝謝,我已經通過AssetsLibrary發現了這個技巧。我希望你的回答對別人有幫助。 – Kai