• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cshum / imagor / 15233384880

25 May 2025 02:40AM UTC coverage: 92.23% (+2.6%) from 89.678%
15233384880

Pull #544

github

github-actions[bot]
test: update golden files
Pull Request #544: feat: introducing vipsgen

307 of 345 new or added lines in 6 files covered. (88.99%)

4867 of 5277 relevant lines covered (92.23%)

1.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.46
/processor/vipsprocessor/exif.go
1
package vipsprocessor
2

3
import "C"
4
import (
5
        "strconv"
6
        "strings"
7
)
8

9
// exifNames to extract, true to cast as int
10
var exifNames = map[string]bool{
11
        "Orientation":           true,
12
        "ResolutionUnit":        true,
13
        "YCbCrPositioning":      true,
14
        "Compression":           true,
15
        "exifExposureProgram":   true,
16
        "ISOSpeedRatings":       true,
17
        "MeteringMode":          true,
18
        "Flash":                 true,
19
        "ColorSpace":            true,
20
        "PixelXDimension":       true,
21
        "PixelYDimension":       true,
22
        "SensingMethod":         true,
23
        "ExposureMode":          true,
24
        "WhiteBalance":          true,
25
        "FocalLengthIn35mmFilm": true,
26
        "SceneCaptureType":      true,
27
}
28

29
func exifStringShort(s string) string {
1✔
30
        i := strings.Index(s, " (")
1✔
31
        if i > -1 {
2✔
32
                return s[:i]
1✔
33
        }
1✔
NEW
34
        return s
×
35
}
36

37
func extractExif(rawExif map[string]string) map[string]any {
1✔
38
        var exif = map[string]any{}
1✔
39
        for tag, value := range rawExif {
2✔
40
                if len(tag) < 10 {
2✔
41
                        continue
1✔
42
                }
43
                name := tag[10:]
1✔
44
                value = strings.TrimSpace(exifStringShort(value))
1✔
45
                if value == "" {
2✔
46
                        continue
1✔
47
                }
48
                if exifNames[name] {
2✔
49
                        val, err := strconv.Atoi(value)
1✔
50
                        if err == nil {
2✔
51
                                exif[name] = val
1✔
52
                        } else {
1✔
NEW
53
                                exif[name] = value
×
NEW
54
                        }
×
55
                } else {
1✔
56
                        exif[name] = value
1✔
57
                }
1✔
58
        }
59
        return exif
1✔
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc