我正在創建一個應用程序,我從瀏覽器中保存縮略圖。一切工作正常,直到我傾向於將包含此文件的目錄移動到其他目錄。 它給這個錯誤:UIImagePNGRepresentation(UIImage)拋出libpng錯誤:沒有寫入文件的IDAT
ImageIO: CGImageRead_mapData 'open' failed '/Users/anuj/Library/Application Support/iPhone Simulator/6.1/Applications/8CD8EB07-6D62-4284-B425-087E821098BC/Library/Caches/PausedVideos/Old School vs. New School/Thumbnail' error = 2 (No such file or directory) ImageIO: CGImageRead_mapData 'open' failed '/Users/anuj/Library/Application Support/iPhone Simulator/6.1/Applications/8CD8EB07-6D62-4284-B425-087E821098BC/Library/Caches/PausedVideos/Old School vs. New School/Thumbnail' error = 2 (No such file or directory) libpng error: No IDATs written into file
繼承人,我使用的代碼:
NSData *data = [NSData dataWithData:UIImagePNGRepresentation(video.Thumbnail)];
Thumbnail = [[UIImage imageWithData:data] retain];
我也提到了鏈接here但這並沒有改變任何東西。
Nikhil,似乎沒有圖像數據被寫入你正在轉換。請檢查視頻的字節長度。縮略圖。 – Tarun 2013-03-06 09:28:20
明白了!謝謝@tarun – 2013-03-06 11:03:23