feat: allow to remove ICC profile metadata

This commit is contained in:
Tomas Aparicio 2015-06-13 22:11:54 +01:00
parent 941b15cd9a
commit 5d322714ec
5 changed files with 30 additions and 2 deletions

View file

@ -71,6 +71,21 @@ func TestInvalidRotate(t *testing.T) {
Write("fixtures/test_invalid_rotate_out.jpg", newImg)
}
func TestNoColorProfile(t *testing.T) {
options := Options{Width: 800, Height: 600, NoColorProfile: true}
buf, _ := Read("fixtures/test.jpg")
newImg, err := Resize(buf, options)
if err != nil {
t.Errorf("Resize(imgData, %#v) error: %#v", options, err)
}
metadata, err := Metadata(newImg)
if metadata.Profile == true {
t.Fatal("Invalid profile data")
}
}
func TestConvert(t *testing.T) {
width, height := 300, 240
formats := [3]ImageType{PNG, WEBP, JPEG}