-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add ICC profile option to withMetadata #2271
Conversation
Augments the `withMetadata()` function to accept a `profile` option to provide the path to a custom output colour profile eg. .icc or .icm file. Related to lovell#1323
Hi Robert, thank you for the PR, I'll review it as soon as I can. |
Updates the parameter check to `throw` an invalid parameter error in keeping with the orientation check above.
Hi! Is there an option to use the ICC profile embedded in the image instead of stripping it or set custom ICC profile? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for this PR, I've left a few questions/comments inline.
- Added CMYK output test - Updated custom ICC output test to use max colour distance function
Hi @lovell - I made the updates you suggested but still only added one extra test for the cmyk colour space. I'm not sure of other common ones I could add tests for but thought I'd get your feedback on the implementation of the test itself first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, I've left a couple of comments inline but otherwise this is good to merge.
- `options.orientation` **[number][9]?** value between 1 and 8, used to update the EXIF `Orientation` tag. | ||
- `options.icc` **[string][2]?** path to an ICC profile file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This content differs from the JSDoc. Was npm run docs-build
used to update these?
@@ -131,6 +132,7 @@ function toBuffer (options, callback) { | |||
* | |||
* @param {Object} [options] | |||
* @param {number} [options.orientation] value between 1 and 8, used to update the EXIF `Orientation` tag. | |||
* @param {string} [options.icc] path to output ICC profile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth prefixing with "filesystem" here i.e. filesystem path to...
Landed as commit eaecb73, thank you very much for persisting with this Robert. A tea/coffee/beer/relish of your choice next time I'm in Sheffield or you're in London. |
@lovell ace! Thanks very much - sorry I’ve been off this week so didn’t update the PR yet. Thanks for getting it over the line. Really appreciate the code review and advice on this feature. Will definitely take you up on that :) |
This addresses issue #1323 by adding support for applying a custom ICC profile on output.
While this implements the proposed API in the issue I might be missing some of the cases described still. I'd love to get some feedback on whether this is actually the correct approach (bearing in mind I have basically no C++ experience before this!).