第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

問題設(shè)置圖像的exif數(shù)據(jù)

問題設(shè)置圖像的exif數(shù)據(jù)

炎炎設(shè)計(jì) 2019-08-06 15:11:41
問題設(shè)置圖像的exif數(shù)據(jù)我在iOS 4.1中使用新的ImageIO框架。我使用以下代碼成功檢索exif元數(shù)據(jù):CFDictionaryRef metadataDict = CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary , NULL);閱讀它,它似乎是有效的。保存圖像有效,但圖像中從不存在任何exif數(shù)據(jù)。    CGImageDestinationRef myImageDest = CGImageDestinationCreateWithURL((CFURLRef) docurl, kUTTypeJPEG, 1, NULL);     // Add the image to the destination using previously saved options.      CGImageDestinationAddImage(myImageDest, iref, NULL);     //add back exif     NSDictionary *props = [NSDictionary dictionaryWithObjectsAndKeys:                             [NSNumber numberWithFloat:.1], kCGImageDestinationLossyCompressionQuality,                            metadataDict, kCGImagePropertyExifDictionary, //the exif metadata                                                         nil];                           //kCGImagePropertyExifAuxDictionary     CGImageDestinationSetProperties(myImageDest, (CFDictionaryRef) props);     // Finalize the image destination.      bool status = CGImageDestinationFinalize(myImageDest);
查看完整描述

3 回答

?
滄海一幻覺

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超5個(gè)贊

我嘗試了史蒂夫的答案并且它有效,但我認(rèn)為它對(duì)于大型圖像來說很慢,因?yàn)樗鼤?huì)復(fù)制整個(gè)圖像。


您可以使用CMSetAttachments直接在CMSampleBuffer上設(shè)置屬性。在打電話之前這樣做jpegStillImageNSDataRepresentation


CFDictionaryRef metaDict = CMCopyDictionaryOfAttachments(NULL, imageSampleBuffer, kCMAttachmentMode_ShouldPropagate);

CFMutableDictionaryRef mutable = CFDictionaryCreateMutableCopy(NULL, 0, metaDict);


NSMutableDictionary * mutableGPS = [self getGPSDictionaryForLocation:self.myLocation];

CFDictionarySetValue(mutable, kCGImagePropertyGPSDictionary, mutableGPS);


// set the dictionary back to the buffer

CMSetAttachments(imageSampleBuffer, mutable, kCMAttachmentMode_ShouldPropagate);

方法getGPSDictionaryForLocation:可以在這里找到:


在iOS4.1上保存帶照片的地理標(biāo)記信息


查看完整回答
反對(duì) 回復(fù) 2019-08-06
  • 3 回答
  • 0 關(guān)注
  • 685 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)