felixc / rexiv2

Rust library for read/write access to media-file metadata (Exif, XMP, and IPTC)
GNU General Public License v3.0
79 stars 17 forks source link

Fixed raw-tag-access not working #38

Closed Naarakah closed 4 years ago

Naarakah commented 4 years ago

I have fixed a mistake that made raw-tag-access unusable.

felixc commented 4 years ago

Hello again! Thank you very much for the fix!

For my own education, and so I can put it in the commit message for future reference, could you describe the problem and the fix? I'm not familiar enough with Rust FFI to understand the change.

Naarakah commented 4 years ago

A null pointer was passed to glib_sys::g_bytes_get_data as the argument supposed to be used to return the data size, as I initially thought it was possible (because there's another function to get that size), but the C function behind glib_sys::g_bytes_get_data crashes when given a null pointer so I changed that.

felixc commented 4 years ago

Hey! Sorry for the long delay, but this finally landed in https://github.com/felixc/rexiv2/commit/f6c90e7287b3356c6b4029772d521ca49fc91d70.

GitHub doesn't show this PR's status as "merged" because I had to rebase onto some other commits (and I added a test), so I'll have to "close" this — but the change is indeed in master and your contribution is very much appreciated!