Merge pull request #360 from jaberwoky/master

Panic on reading Exif
This commit is contained in:
Tom 2021-08-07 18:02:47 +02:00 committed by GitHub
commit 66447e14d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2 deletions

View file

@ -246,8 +246,9 @@ func vipsExifOrientation(image *C.VipsImage) int {
}
func vipsExifShort(s string) string {
if strings.Contains(s, " (") {
return s[:strings.Index(s, "(")-1]
i := strings.Index(s, " (")
if i > 0 {
return s[:i]
}
return s
}