davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.28k stars 199 forks source link

Add APIs to get image EXIF data and ICC profile data #317

Closed AttilaTheFun closed 2 years ago

AttilaTheFun commented 2 years ago

These are two APIs I've wanted for a while and I finally got around to implementing them + making a pull request.

The first, GetICCProfile, is related to HasICCProfile but it actually returns the byte slice resulting from invoking vips_image_get_blob with the VIPS_META_ICC_NAME parameter.

This is useful for me as well as hopefully other consumers because I want to parse the data with LCMS2 and determine the ICC profile name and whether it's a wide color profile or not.

The second API, GetExif, is related to ImageFields but it actually returns the string values in a map for all of the image fields with an "exif" prefix.

This is useful for pulling interesting information out of images like the type of camera and lens.

AttilaTheFun commented 2 years ago

@tonimelisma @davidbyttow Hey folks! I remember we talked about this a long time ago and I finally got around to implementing it. Let me know what you think!

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.3%) to 76.895% when pulling 6c23f97934d99442ef6e5d69bf55a07b20729c5a on AttilaTheFun:lshire-exif-and-icc into 5f0601eaedac341503c3473588e856be9b71e5af on davidbyttow:master.

AttilaTheFun commented 2 years ago

Awesome, thanks!