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

cshum / imagor / 15246649318

26 May 2025 05:04AM UTC coverage: 92.233% (+0.08%) from 92.156%
15246649318

push

github

web-flow
refactor: vipsgen v0.8.2 (#546)

* remove set_frames

* remove set_frames

* test: reset golden

* test: update golden files

* vipsgen v0.8.2

* test: reset golden

* test: update golden files

4833 of 5240 relevant lines covered (92.23%)

1.1 hits per line

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

84.62
/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
        "FocalPlaneResolutionUnit": true,
14
        "YCbCrPositioning":         true,
15
        "Compression":              true,
16
        "exifExposureProgram":      true,
17
        "ISOSpeedRatings":          true,
18
        "MeteringMode":             true,
19
        "Flash":                    true,
20
        "ColorSpace":               true,
21
        "PixelXDimension":          true,
22
        "PixelYDimension":          true,
23
        "SensingMethod":            true,
24
        "ExposureMode":             true,
25
        "WhiteBalance":             true,
26
        "FocalLengthIn35mmFilm":    true,
27
        "SceneCaptureType":         true,
28
}
29

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

38
func extractExif(rawExif map[string]string) map[string]any {
1✔
39
        var exif = map[string]any{}
1✔
40
        for tag, value := range rawExif {
2✔
41
                if len(tag) < 10 {
1✔
42
                        continue
×
43
                }
44
                name := tag[10:]
1✔
45
                value = strings.TrimSpace(exifStringShort(value))
1✔
46
                if value == "" {
2✔
47
                        continue
1✔
48
                }
49
                if exifNames[name] {
2✔
50
                        val, err := strconv.Atoi(value)
1✔
51
                        if err == nil {
2✔
52
                                exif[name] = val
1✔
53
                        } else {
1✔
54
                                exif[name] = value
×
55
                        }
×
56
                } else {
1✔
57
                        exif[name] = value
1✔
58
                }
1✔
59
        }
60
        return exif
1✔
61
}
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