Forum Archive

How to Save Images With and Without EXIF Metadata to Camera Roll/Clipboard

zjtafsjgd7

Hi there,

In my Editorial workflow, I want to get an image from the clipboard or the camera roll, do some processing, and then export the image to the clipboard or the camera roll by either a) including or b) excluding the original EXIF image metadata (I am mainly interested in the geolocation information).

From my testing, it seems photos are always exported without the original metadata. Can I trust this to be always true? I assume the img object in the following Python script doesn't even contain the metadata itself, is this correct? On the other hand, how can I actually include the metadata when exporting the image to the clipboard or camera roll?

import photos
import clipboard


# Image input: From camera roll or clipboard
img = photos.get_image(-1)
# img = clipboard.get_image()

# Processing
# ...

# Image output: To camera roll or clipboard
# Depending on user choice, I want the exported image to either include or exclude the metadata
photos.save_image(img)
# clipboard.set_image(img, format='jpg', jpeg_quality=1)

Thanks for any help!

TutorialDoctor

You are in the Editorial forums, try the Pythonista forum.

zjtafsjgd7

Oops sorry, I actually meant Editorial (edited original post).

ccc

http://omz-software.com/pythonista/docs/ios/photos.html#photos.get_metadata

The Photos module has a get_metadata() function but does not have a put_metadata() function so images saved to the camera roll are stripped of all metadata.