iOS:在 Marker APP3 上访问 JPEG 元数据
我一直在使用 Exif 标签通过以下方式在 jpeg 文件上存储一些数据:
CGImageSourceRef source = CGImageSourceCreateWithURL(baseURL, NULL);
NSDictionary *metadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL);
NSMutableDictionary *metadataAsMutable = [[metadata mutableCopy]autorelease];
NSMutableDictionary *EXIFDictionary = [[[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy]autorelease];
[EXIFDictionary setObject:[NSString stringWithFormat:@"%d",tag] forKey:(NSString *)kCGImagePropertyExifUserComment];
现在,我想使用自定义应用程序标记(APP3 位于 0xFFE3)而不是 Exif 标记。
(请参阅 - http://www.ozhiker.com/ electronics/pjmt/jpeg_info/ app_segments.html)
有人能指出我正确的方向吗?
PS:我正在使用越狱的 iPad 来运行此应用程序。
I have been using the Exif tags to store some data on jpeg files in the following manner:
CGImageSourceRef source = CGImageSourceCreateWithURL(baseURL, NULL);
NSDictionary *metadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL);
NSMutableDictionary *metadataAsMutable = [[metadata mutableCopy]autorelease];
NSMutableDictionary *EXIFDictionary = [[[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy]autorelease];
[EXIFDictionary setObject:[NSString stringWithFormat:@"%d",tag] forKey:(NSString *)kCGImagePropertyExifUserComment];
Now, I would like to use a custom Application Marker (APP3 at 0xFFE3) instead of Exif Marker.
(Refer - http://www.ozhiker.com/electronics/pjmt/jpeg_info/app_segments.html)
Could someone point me in the right direction.
PS: I am using a jailbroken iPad for this app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,看来我们必须通过文件处理程序的方式来实现这一点。这就是我所做的,尽管可能有更好的方法来做到这一点。
创建文件句柄:
然后迭代文件内容,直到找到所需的标记:
这将为您提供 APP3 标记的偏移量,如果您需要添加自己的 app3 标记,则可以使用类似的方法。
Okay, it seems we have to go via file handler way for this. Here is what I did, though there may be a better way to do this.
Create a File handle:
Then iterate the file contents till you find a desired tag:
This gives you the offset to the APP3 marker, incase you need to add your own app3 marker you can use a similar approach.