mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-09 07:28:44 -07:00
feat: allow to remove ICC profile metadata
This commit is contained in:
parent
941b15cd9a
commit
5d322714ec
5 changed files with 30 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue