mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
remove unsupported exif tags
This commit is contained in:
parent
afd5149c74
commit
f4dc6a5e2d
2 changed files with 0 additions and 94 deletions
45
metadata.go
45
metadata.go
|
|
@ -36,7 +36,6 @@ const (
|
|||
MakerNote = "exif-ifd2-MakerNote"
|
||||
SubSecTimeOriginal = "exif-ifd2-SubSecTimeOriginal"
|
||||
SubSecTimeDigitized = "exif-ifd2-SubSecTimeDigitized"
|
||||
FlashPixVersion = "exif-ifd2-FlashpixVersion"
|
||||
ColorSpace = "exif-ifd2-ColorSpace"
|
||||
PixelXDimension = "exif-ifd2-PixelXDimension"
|
||||
PixelYDimension = "exif-ifd2-PixelYDimension"
|
||||
|
|
@ -46,16 +45,6 @@ const (
|
|||
WhiteBalance = "exif-ifd2-WhiteBalance"
|
||||
FocalLengthIn35mmFilm = "exif-ifd2-FocalLengthIn35mmFilm"
|
||||
SceneCaptureType = "exif-ifd2-SceneCaptureType"
|
||||
LensSpecification = "exif-ifd2-LensSpecification"
|
||||
LensMake = "exif-ifd2-LensMake"
|
||||
LensModel = "exif-ifd2-LensModel"
|
||||
CompositeImage = "exif-ifd2-CompositeImage"
|
||||
UserComment = "exif-ifd2-UserComment"
|
||||
SubSecTime = "exif-ifd2-SubsecTime"
|
||||
FocalPlaneXResolution = "exif-ifd2-FocalPlaneXResolution"
|
||||
FocalPlaneYResolution = "exif-ifd2-FocalPlaneYResolution"
|
||||
FocalPlaneResolutionUnit = "exif-ifd2-FocalPlaneResolutionUnit"
|
||||
CustomRendered = "exif-ifd2-CustomRendered"
|
||||
GPSLatitudeRef = "exif-ifd3-GPSLatitudeRef"
|
||||
GPSLatitude = "exif-ifd3-GPSLatitude"
|
||||
GPSLongitudeRef = "exif-ifd3-GPSLongitudeRef"
|
||||
|
|
@ -69,10 +58,6 @@ const (
|
|||
GPSDestBearingRef = "exif-ifd3-GPSDestBearingRef"
|
||||
GPSDestBearing = "exif-ifd3-GPSDestBearing"
|
||||
GPSDateStamp = "exif-ifd3-GPSDateStamp"
|
||||
GPSHPositioningError = "exif-ifd3-GPSHPositioningError"
|
||||
GPSVersionID = "exif-ifd3-GPSVersionID"
|
||||
InteroperabilityIndex = "exif-ifd4-InteroperabilityIndex"
|
||||
InteroperabilityVersion = "exif-ifd4-InteroperabilityVersion"
|
||||
)
|
||||
|
||||
// ImageSize represents the image width and height values
|
||||
|
|
@ -124,7 +109,6 @@ type EXIF struct {
|
|||
MakerNote string
|
||||
SubSecTimeOriginal string
|
||||
SubSecTimeDigitized string
|
||||
FlashPixVersion string
|
||||
ColorSpace int
|
||||
PixelXDimension int
|
||||
PixelYDimension int
|
||||
|
|
@ -134,16 +118,6 @@ type EXIF struct {
|
|||
WhiteBalance int
|
||||
FocalLengthIn35mmFilm int
|
||||
SceneCaptureType int
|
||||
LensSpecification string
|
||||
LensMake string
|
||||
LensModel string
|
||||
CompositeImage int
|
||||
UserComment string
|
||||
SubSecTime string
|
||||
FocalPlaneXResolution string
|
||||
FocalPlaneYResolution string
|
||||
FocalPlaneResolutionUnit int
|
||||
CustomRendered int
|
||||
GPSLatitudeRef string
|
||||
GPSLatitude string
|
||||
GPSLongitudeRef string
|
||||
|
|
@ -157,10 +131,6 @@ type EXIF struct {
|
|||
GPSDestBearingRef string
|
||||
GPSDestBearing string
|
||||
GPSDateStamp string
|
||||
GPSHPositioningError string
|
||||
GPSVersionID string
|
||||
InteroperabilityIndex string
|
||||
InteroperabilityVersion string
|
||||
}
|
||||
|
||||
// Size returns the image size by width and height pixels.
|
||||
|
|
@ -242,7 +212,6 @@ func Metadata(buf []byte) (ImageMetadata, error) {
|
|||
MakerNote: vipsExifStringTag(image, MakerNote),
|
||||
SubSecTimeOriginal: vipsExifStringTag(image, SubSecTimeOriginal),
|
||||
SubSecTimeDigitized: vipsExifStringTag(image, SubSecTimeDigitized),
|
||||
FlashPixVersion: vipsExifStringTag(image, FlashPixVersion),
|
||||
ColorSpace: vipsExifIntTag(image, ColorSpace),
|
||||
PixelXDimension: vipsExifIntTag(image, PixelXDimension),
|
||||
PixelYDimension: vipsExifIntTag(image, PixelYDimension),
|
||||
|
|
@ -252,16 +221,6 @@ func Metadata(buf []byte) (ImageMetadata, error) {
|
|||
WhiteBalance: vipsExifIntTag(image, WhiteBalance),
|
||||
FocalLengthIn35mmFilm: vipsExifIntTag(image, FocalLengthIn35mmFilm),
|
||||
SceneCaptureType: vipsExifIntTag(image, SceneCaptureType),
|
||||
LensSpecification: vipsExifStringTag(image, LensSpecification),
|
||||
LensMake: vipsExifStringTag(image, LensMake),
|
||||
LensModel: vipsExifStringTag(image, LensModel),
|
||||
CompositeImage: vipsExifIntTag(image, CompositeImage),
|
||||
UserComment: vipsExifStringTag(image, UserComment),
|
||||
SubSecTime: vipsExifStringTag(image, SubSecTime),
|
||||
FocalPlaneXResolution: vipsExifStringTag(image, FocalPlaneXResolution),
|
||||
FocalPlaneYResolution: vipsExifStringTag(image, FocalPlaneYResolution),
|
||||
FocalPlaneResolutionUnit: vipsExifIntTag(image, FocalPlaneResolutionUnit),
|
||||
CustomRendered: vipsExifIntTag(image, CustomRendered),
|
||||
GPSLatitudeRef: vipsExifStringTag(image, GPSLatitudeRef),
|
||||
GPSLatitude: vipsExifStringTag(image, GPSLatitude),
|
||||
GPSLongitudeRef: vipsExifStringTag(image, GPSLongitudeRef),
|
||||
|
|
@ -275,10 +234,6 @@ func Metadata(buf []byte) (ImageMetadata, error) {
|
|||
GPSDestBearingRef: vipsExifStringTag(image, GPSDestBearingRef),
|
||||
GPSDestBearing: vipsExifStringTag(image, GPSDestBearing),
|
||||
GPSDateStamp: vipsExifStringTag(image, GPSDateStamp),
|
||||
GPSHPositioningError: vipsExifStringTag(image, GPSHPositioningError),
|
||||
GPSVersionID: vipsExifStringTag(image, GPSVersionID),
|
||||
InteroperabilityIndex: vipsExifStringTag(image, InteroperabilityIndex),
|
||||
InteroperabilityVersion: vipsExifStringTag(image, InteroperabilityVersion),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ func TestEXIF(t *testing.T) {
|
|||
ResolutionUnit: 2,
|
||||
YCbCrPositioning: 1,
|
||||
ExifVersion: "Exif Version 2.1",
|
||||
FlashPixVersion: "FlashPix Version 1.0",
|
||||
ColorSpace: 65535,
|
||||
},
|
||||
"test_exif.jpg": {
|
||||
|
|
@ -121,7 +120,6 @@ func TestEXIF(t *testing.T) {
|
|||
MeteringMode: 1,
|
||||
Flash: 0,
|
||||
FocalLength: "4/1",
|
||||
FlashPixVersion: "FlashPix Version 1.0",
|
||||
WhiteBalance: 1,
|
||||
ColorSpace: 65535,
|
||||
},
|
||||
|
|
@ -150,23 +148,14 @@ func TestEXIF(t *testing.T) {
|
|||
MeteringMode: 5,
|
||||
Flash: 9,
|
||||
FocalLength: "135/1",
|
||||
SubSecTime: "00",
|
||||
SubSecTimeOriginal: "00",
|
||||
SubSecTimeDigitized: "00",
|
||||
FlashPixVersion: "FlashPix Version 1.0",
|
||||
ColorSpace: 1,
|
||||
PixelXDimension: 100,
|
||||
PixelYDimension: 68,
|
||||
FocalPlaneXResolution: "3888000/876",
|
||||
FocalPlaneYResolution: "2592000/583",
|
||||
FocalPlaneResolutionUnit: 2,
|
||||
CustomRendered: 0,
|
||||
ExposureMode: 1,
|
||||
WhiteBalance: 0,
|
||||
SceneCaptureType: 0,
|
||||
GPSVersionID: "2.2.0.0",
|
||||
InteroperabilityIndex: "R98",
|
||||
InteroperabilityVersion: "0100",
|
||||
},
|
||||
"test_exif_full.jpg": {
|
||||
Make: "Apple",
|
||||
|
|
@ -207,10 +196,6 @@ func TestEXIF(t *testing.T) {
|
|||
WhiteBalance: 0,
|
||||
FocalLengthIn35mmFilm: 26,
|
||||
SceneCaptureType: 0,
|
||||
LensSpecification: "17/4 6/1 9/5 12/5",
|
||||
LensMake: "Apple",
|
||||
LensModel: "iPhone XS back dual camera 4.25mm f/1.8",
|
||||
CompositeImage: 2,
|
||||
GPSLatitudeRef: "N",
|
||||
GPSLatitude: "55/1 43/1 5287/100",
|
||||
GPSLongitudeRef: "E",
|
||||
|
|
@ -224,7 +209,6 @@ func TestEXIF(t *testing.T) {
|
|||
GPSDestBearingRef: "M",
|
||||
GPSDestBearing: "192127/921",
|
||||
GPSDateStamp: "2020:07:28",
|
||||
GPSHPositioningError: "99327/19144",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -347,27 +331,6 @@ func TestEXIF(t *testing.T) {
|
|||
if metadata.EXIF.SceneCaptureType != file.SceneCaptureType {
|
||||
t.Fatalf("Unexpected image exif SceneCaptureType: %d != %d", metadata.EXIF.SceneCaptureType, file.SceneCaptureType)
|
||||
}
|
||||
if metadata.EXIF.CompositeImage != file.CompositeImage {
|
||||
t.Fatalf("Unexpected image exif CompositeImage: %d != %d", metadata.EXIF.CompositeImage, file.CompositeImage)
|
||||
}
|
||||
if metadata.EXIF.UserComment != file.UserComment {
|
||||
t.Fatalf("Unexpected image exif UserComment: %s != %s", metadata.EXIF.UserComment, file.UserComment)
|
||||
}
|
||||
if metadata.EXIF.SubSecTime != file.SubSecTime {
|
||||
t.Fatalf("Unexpected image exif SubSecTime: %s != %s", metadata.EXIF.SubSecTime, file.SubSecTime)
|
||||
}
|
||||
if metadata.EXIF.FocalPlaneXResolution != file.FocalPlaneXResolution {
|
||||
t.Fatalf("Unexpected image exif FocalPlaneXResolution: %s != %s", metadata.EXIF.FocalPlaneXResolution, file.FocalPlaneXResolution)
|
||||
}
|
||||
if metadata.EXIF.FocalPlaneYResolution != file.FocalPlaneYResolution {
|
||||
t.Fatalf("Unexpected image exif FocalPlaneYResolution: %s != %s", metadata.EXIF.FocalPlaneYResolution, file.FocalPlaneYResolution)
|
||||
}
|
||||
if metadata.EXIF.FocalPlaneResolutionUnit != file.FocalPlaneResolutionUnit {
|
||||
t.Fatalf("Unexpected image exif FocalPlaneResolutionUnit: %d != %d", metadata.EXIF.FocalPlaneResolutionUnit, file.FocalPlaneResolutionUnit)
|
||||
}
|
||||
if metadata.EXIF.CustomRendered != file.CustomRendered {
|
||||
t.Fatalf("Unexpected image exif CustomRendered: %d != %d", metadata.EXIF.CustomRendered, file.CustomRendered)
|
||||
}
|
||||
if metadata.EXIF.GPSLatitudeRef != file.GPSLatitudeRef {
|
||||
t.Fatalf("Unexpected image exif GPSLatitudeRef: %s != %s", metadata.EXIF.GPSLatitudeRef, file.GPSLatitudeRef)
|
||||
}
|
||||
|
|
@ -407,18 +370,6 @@ func TestEXIF(t *testing.T) {
|
|||
if metadata.EXIF.GPSDateStamp != file.GPSDateStamp {
|
||||
t.Fatalf("Unexpected image exif GPSDateStamp: %s != %s", metadata.EXIF.GPSDateStamp, file.GPSDateStamp)
|
||||
}
|
||||
if metadata.EXIF.GPSHPositioningError != file.GPSHPositioningError {
|
||||
t.Fatalf("Unexpected image exif GPSHPositioningError: %s != %s", metadata.EXIF.GPSHPositioningError, file.GPSHPositioningError)
|
||||
}
|
||||
if metadata.EXIF.GPSVersionID != file.GPSVersionID {
|
||||
t.Fatalf("Unexpected image exif GPSVersionID: %s != %s", metadata.EXIF.GPSVersionID, file.GPSVersionID)
|
||||
}
|
||||
if metadata.EXIF.InteroperabilityIndex != file.InteroperabilityIndex {
|
||||
t.Fatalf("Unexpected image exif InteroperabilityIndex: %s != %s", metadata.EXIF.InteroperabilityIndex, file.InteroperabilityIndex)
|
||||
}
|
||||
if metadata.EXIF.InteroperabilityVersion != file.InteroperabilityVersion {
|
||||
t.Fatalf("Unexpected image exif InteroperabilityVersion: %s != %s", metadata.EXIF.InteroperabilityVersion, file.InteroperabilityVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue