akaru
akaru

Reputation: 6317

How to write or modify EXIF data for an existing image on the filesystem, without loading the image?

I've asked similar questions before, but have not received a definitive answer. Seems that there must be a way to simply add/modify metadata to an image without loading the image into memory, without having to deal with directly reading bits.

Seems like ways exist when using CMSampleBufferRefs, but I need to be able to do this with a regular image already saved to disk.
For instance, given a very large png at /Documents/photo.png, I want to modify its exif metadata without having to load that image.

Upvotes: 5

Views: 4473

Answers (2)

Zelter Ady
Zelter Ady

Reputation: 6338

If you know how to modify the EXIF, you can modify the binary data directly from the file. Just replace in the image the binary portion with the new one. I don't know if objective-c permit this, but in ansi c should be simple. The complicate part is to identify the exact part to change.

Upvotes: 0

user529758
user529758

Reputation:

You can use libexif - I've had success with compiling it for iOS before. With libexif, you can modify any image's EXIF metadata.

Upvotes: 9

Related Questions