Skip to content

Commit

Permalink
Ensure ICC profiles are licenced for distribution #486
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Jul 4, 2016
1 parent 85f20c6 commit 91e1ed1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Requires libvips v8.3.1
[#456](https://github.com/lovell/sharp/pull/456)
[@kapouer](https://github.com/kapouer)

* Ensure ICC profiles are licenced for distribution.
[#486](https://github.com/lovell/sharp/issues/486)
[@kapouer](https://github.com/kapouer)

#### v0.15.0 - 21<sup>st</sup> May 2016

* Use libvips' new Lanczos 3 kernel as default for image reduction.
Expand Down
Binary file removed icc/USWebCoatedSWOP.icc
Binary file not shown.
Binary file added icc/cmyk.icm
Binary file not shown.
Binary file added icc/sRGB.icc
Binary file not shown.
Binary file removed icc/sRGB_IEC61966-2-1_black_scaled.icc
Binary file not shown.
8 changes: 4 additions & 4 deletions src/pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class PipelineWorker : public AsyncWorker {
// Increment processing task counter
g_atomic_int_inc(&counterProcess);

// Latest v2 sRGB ICC profile
std::string srgbProfile = baton->iccProfilePath + "sRGB_IEC61966-2-1_black_scaled.icc";
// Default sRGB ICC profile from https://packages.debian.org/sid/all/icc-profiles-free/filelist
std::string srgbProfile = baton->iccProfilePath + "sRGB.icc";

// Input
ImageType inputImageType = ImageType::UNKNOWN;
Expand Down Expand Up @@ -385,8 +385,8 @@ class PipelineWorker : public AsyncWorker {
// Ignore failure of embedded profile
}
} else if (image.interpretation() == VIPS_INTERPRETATION_CMYK) {
// Convert to sRGB using default "USWebCoatedSWOP" CMYK profile
std::string cmykProfile = baton->iccProfilePath + "USWebCoatedSWOP.icc";
// Convert to sRGB using default CMYK profile from http://www.argyllcms.com/cmyk.icm
std::string cmykProfile = baton->iccProfilePath + "cmyk.icm";
image = image.icc_transform(const_cast<char*>(srgbProfile.data()), VImage::option()
->set("input_profile", cmykProfile.data())
->set("intent", VIPS_INTENT_PERCEPTUAL)
Expand Down
4 changes: 3 additions & 1 deletion test/unit/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ describe('Image metadata', function() {
assert.strictEqual(true, metadata.icc instanceof Buffer);
var profile = icc.parse(metadata.icc);
assert.strictEqual('object', typeof profile);
assert.strictEqual('sRGB IEC61966-2-1 black scaled', profile.description);
assert.strictEqual('RGB', profile.colorSpace);
assert.strictEqual('Perceptual', profile.intent);
assert.strictEqual('Monitor', profile.deviceClass);
done();
});
});
Expand Down

0 comments on commit 91e1ed1

Please sign in to comment.