photoprism/internal/thumb/open_test.go
Michael Mayer 5be456a09f JPEG: Convert Apple "Display P3" colors to standard sRGB #1474
Other color profiles and file formats are not supported yet. Should
be easy to add though. Main difficulty will be profile name comparison:
For example "Adobe RGB (1998)" vs just "Adobe RGB".
2021-12-09 07:00:39 +01:00

59 lines
972 B
Go

package thumb
import (
"testing"
)
func TestOpen(t *testing.T) {
t.Run("JPEG", func(t *testing.T) {
img, err := Open("testdata/example.jpg", 0)
if err != nil {
t.Fatal(err)
}
if img == nil {
t.Error("img must not be nil")
}
})
t.Run("BMP", func(t *testing.T) {
img, err := Open("testdata/example.bmp", 0)
if err != nil {
t.Fatal(err)
}
if img == nil {
t.Error("img must not be nil")
}
})
t.Run("GIF", func(t *testing.T) {
img, err := Open("testdata/example.gif", 0)
if err != nil {
t.Fatal(err)
}
if img == nil {
t.Error("img must not be nil")
}
})
t.Run("PNG", func(t *testing.T) {
img, err := Open("testdata/example.png", 0)
if err != nil {
t.Fatal(err)
}
if img == nil {
t.Error("img must not be nil")
}
})
t.Run("TIFF", func(t *testing.T) {
img, err := Open("testdata/example.tif", 0)
if err != nil {
t.Fatal(err)
}
if img == nil {
t.Error("img must not be nil")
}
})
}