TNThieding/exif

Feature request: an indexed setter to match Image.get()

Closed this issue · 2 comments

I really like the simplicity of the attribute-based approach to accessing tags. It is great for the majority of cases where you know which tags you want to access up front.

Counter to this, in #7 we discussed how to iterate over all of the tags and display them. Now that we have Image.get() we have a way to do this.

However, there is not an equivalent Image.set(tag: str, value: Any) at present.

If I wanted to display all of the tags in a table and allow the user to edit that table and write back their changes then I would need something like this.

Providing this function could perhaps also give an interface for writing out tags that do not yet exist. e.g. adding GPS information to a photo downloaded through Google Photos API.

Finally, to complete the set if your user wants to mess with unusual tags you might need Image.setById(id: int, value: Any)

I'm currently working on these changes. However, I think I'm going to save Image.setById() for #10 since it better aligns with that feature. Thanks for the patience -- my apologies that I've not had a lot of time recently to actively develop this package.

I just released version 0.5.0 of the package (see #16), which adds indexed get/set/delete and set()/delete() methods. Don't hesitate to follow-up with an additional issue if necessary.