mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
remove test file and add the check
This commit is contained in:
parent
c0553ce489
commit
08f64c4145
2 changed files with 6 additions and 2 deletions
|
|
@ -21,7 +21,6 @@ func TestDeterminateImageType(t *testing.T) {
|
|||
{"test.jp2", MAGICK},
|
||||
{"test.heic", HEIF},
|
||||
{"test2.heic", HEIF},
|
||||
{"C001.heic", HEIF},
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
|
|
|
|||
7
vips.go
7
vips.go
|
|
@ -654,6 +654,11 @@ func vipsImageType(buf []byte) ImageType {
|
|||
// This is a HEIF file
|
||||
return HEIF
|
||||
}
|
||||
if IsTypeSupported(HEIF) && buf[4] == 0x66 && buf[5] == 0x74 && buf[6] == 0x79 && buf[7] == 0x70 &&
|
||||
buf[8] == 0x6d && buf[9] == 0x73 && buf[10] == 0x66 && buf[11] == 0x31 {
|
||||
// This is a HEIFS file
|
||||
return HEIF
|
||||
}
|
||||
|
||||
return UNKNOWN
|
||||
}
|
||||
|
|
@ -733,4 +738,4 @@ func vipsGamma(image *C.VipsImage, Gamma float64) (*C.VipsImage, error) {
|
|||
return nil, catchVipsError()
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue