-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added addProfile to MagickImage (#91)
- Loading branch information
1 parent
9285e9c
commit 2375598
Showing
4 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
import { IMagickImage, MagickImage } from '../../src/magick-image'; | ||
import { TestImages } from '../test-images'; | ||
|
||
let image: IMagickImage; | ||
|
||
beforeEach(() => { | ||
image = MagickImage.create(); | ||
}); | ||
|
||
afterEach(() => { | ||
image.dispose(); | ||
}); | ||
|
||
describe('MagickImage#addProfile', () => { | ||
it('should add the profile', () => { | ||
TestImages.fujiFilmFinePixS1ProJpg.use(sourceImage => { | ||
const profile = sourceImage.getProfile('icc'); | ||
expect(profile).not.toBeNull(); | ||
|
||
if (profile !== null) { | ||
expect(profile.name).toEqual('icc'); | ||
const profileData = profile.getData(); | ||
expect(profileData).not.toBeNull(); | ||
|
||
if (profileData !== null) { | ||
expect(profileData.length).toBe(3144); | ||
image.addProfile('icc', profileData); | ||
const profile = image.getProfile('icc'); | ||
expect(profile).not.toBeNull(); | ||
|
||
if (profile !== null) { | ||
expect(profile.name).toEqual('icc'); | ||
const data = profile.getData(); | ||
expect(data).not.toBeNull(); | ||
|
||
if (data !== null) | ||
expect(data.length).toBe(3144); | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters