Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for editing exifs #13

Open
i5-650 opened this issue Sep 18, 2024 · 5 comments
Open

Support for editing exifs #13

i5-650 opened this issue Sep 18, 2024 · 5 comments

Comments

@i5-650
Copy link

i5-650 commented Sep 18, 2024

Hey,

Do you plan on adding support for editing exits ?

That would make me switch from rexiv2 to your lib.

@mindeng
Copy link
Owner

mindeng commented Sep 18, 2024

Hi @i5-650

Thank you for your feedback! I will definitely consider adding editing features in future versions. However, it may be done step by step based on priority. For example, we might start with some commonly used editing features, such as:

  • Modifying time information
  • Editing GPS information
  • Erasing all Exif/Metadata

Do you have any suggestions? Or are there other editing features you’d like to see prioritized? Please feel free to share your thoughts. Thank you!

@i5-650
Copy link
Author

i5-650 commented Sep 18, 2024

Great!

You've already mentioned the most important points (in my opinion), but I’d like to expand on this. My goal is to edit all EXIF data in a file, particularly for images.

If I may suggest a few thing:

  • Displayable EXIF data: You already have this functionality, which is great!
  • Serializable EXIF data: I’m currently working on an EXIF tool/editor that will allow users to edit EXIF data interactively—similar to how git rebase -i opens up Vim (on Linux) then use what the user wrote. Having EXIF data that can be easily serialized/deserialized would help immensely in this project.

@mindeng
Copy link
Owner

mindeng commented Sep 19, 2024

Great!

You've already mentioned the most important points (in my opinion), but I’d like to expand on this. My goal is to edit all EXIF data in a file, particularly for images.

If I may suggest a few thing:

  • Displayable EXIF data: You already have this functionality, which is great!
  • Serializable EXIF data: I’m currently working on an EXIF tool/editor that will allow users to edit EXIF data interactively—similar to how git rebase -i opens up Vim (on Linux) then use what the user wrote. Having EXIF data that can be easily serialized/deserialized would help immensely in this project.

I think the serialization function should be considered already available, just
enable the feature json_dump. You can refer to the usage in rexiftool.

Deserialization may be a bit problematic, mainly because there should be no way
to distinguish numeric types in json, for example, u8/u16/u32/u64 may be the
same to json, but different when reading and writing to Exif. Therefore, you
may need to carry out separate serialization and deserialization designs
according to your demand scenarios, which may be more flexible in the
application.

@i5-650
Copy link
Author

i5-650 commented Sep 20, 2024

Yes, serialization is already implemented (and it's great!), but I think we might be able to work around deserialization in some way. (I'm not an expert on EXIFs, so please correct me if I'm wrong.)

Based on the tag name, we could define an Enum that might look something like this:

#[derive(Debug, Serialize, Deserialize)]
enum ExifTag {
    SonyRawImageSize(i16),
    BlackLevel(i16),
    ExposureTime(f32),
    IsoSpeed(i32),
    // Add more EXIF tags and their types here
}

Therefore, we could serialize from a JSON file! However, that would imply having a huge Enum...

Let me know what you think about that

@mindeng
Copy link
Owner

mindeng commented Sep 21, 2024

Yes, serialization is already implemented (and it's great!), but I think we might be able to work around deserialization in some way. (I'm not an expert on EXIFs, so please correct me if I'm wrong.)

Based on the tag name, we could define an Enum that might look something like this:

#[derive(Debug, Serialize, Deserialize)]
enum ExifTag {
    SonyRawImageSize(i16),
    BlackLevel(i16),
    ExposureTime(f32),
    IsoSpeed(i32),
    // Add more EXIF tags and their types here
}

Therefore, we could serialize from a JSON file! However, that would imply having a huge Enum...

Let me know what you think about that

In fact, EntryValue has already done this. You can try using format!("{:?}", entry_value) directly. However, parsing from str has not been implemented yet, but this shouldn't be a problem to handle at the application layer. If needed, we could also consider adding that implementation to the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants