-
Notifications
You must be signed in to change notification settings - Fork 44
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
Plans to add support for writing tags? #1
Comments
It depends on your use case. If you are writing Exif data from scratch, it is easy. I will add some support. (Actually, I have scribbled a pre-pre-pre-alpha-quality encoder before, so I need to salvage it...) If you are modifying existing data, the situation becomes tricky. The problem is that some opaque fields (e.g., MakerNote) may have non-relative offsets in them and they are broken if their positions are changed, unless we deep-inspect and rewrite them. A well-known heuristic is to keep the absolute positions of such fields while reencoding the Exif structure, but it is bothersome. 😫 If you only add GPS tags, the easiest way might be to implement a special logic only for that. |
It would be modifying existing data, I didn't think about non-relative offsets... My use-case only requires writing GPS tags, and since they sit separately, special logic would probably be best for them. |
I have checked in the experimental support for the former use case. |
Thanks, I'll check it out when I get the chance. 👍 |
This is a very old issue. I'm just wondering if there are any plans to implement it? I'm just looking to write date/time exif information in case it's missing... |
I abandoned the project that involved needing to write EXIF data before I made much progress (and I was only looking at GPS tags anyway). |
It seems like the https://github.com/liamstask/imagemeta-rs project has some support for it, but that one looks abandoned as well... |
The following steps mostly work, except that MakerNote of some makes will be broken. Do no do this unless relocation of MakerNote is known to be safe with your camera.
Missing pieces are:
|
Thanks @kamadak for the details. On point 7, do you know a JPEG library that would be able to do this? I looked around and found https://github.com/image-rs/image but I could not find a way using that library to set the EXIF data... |
I have thought there must be some, but I searched on the web to find nothing in Rust. Enhancing the encoder of the image library you mentioned seems very easy. |
I think you search something like img-parts |
img-parts author here. Thanks @NelDav for mentioning my crate. As you said img-parts can be used to read and write raw EXIF data to images. It currently supports JPEG, PNG and WEBP, with more formats to come in the future. You can use this crate to generate the raw data and have it written to the file through my crate, as shown in the example |
Thanks for those detailed instructions on how to update EXIF data! For some images, I got the exact same binary size for the rewritten raw data. For others, I didn't. Is this expected or does that mean I'm missing some data in the new EXIF? It also looks like the order of fields changes. Is that correct and if so, is that avoidable?
Would you accept a PR adding those functions to either |
Why is this ? It would be just great of this would be possible. even if currently only for standard jpeg picture files. BTW.: what would JPG files without image be useful for ? BTW/2:
I tried to test BTW/3: |
Here -> image-rs/image#1045 on on Nov 23, 2020, you write it already should work ???? |
I forked rexif to add support for writing GPS tags to it, but upstream hasn't been touched in over a year, the only tests it has are the ones I've added, and I've had to spend time improving the implementation. On the other hand, this library seems to have come on leaps and bounds since I last saw it, and I'm wondering if I should maybe switch my efforts.
Do you plan on adding write support, and if not, would you be interested in a pull request adding it?
The text was updated successfully, but these errors were encountered: