Comments (7)
from go-exif.
from go-exif.
Hi, I met the same issue so I can explain more for @mysterytree .
The VALUE
field contains [106/1]
which doesn't seem like a coordinate value. If extracted by another programme that reads EXIF, this field's value is 116 deg 23' 27.00".
What could possibly go wrong here?
Also @mysterytree could you share you code snippet? Thanks!
from go-exif.
package main
import (
"fmt"
"io/ioutil"
"os"
exif "github.com/dsoprea/go-exif"
log "github.com/dsoprea/go-logging"
)
func main() {
f, err := os.Open("F9_114_000015.jpg")
log.PanicIf(err)
data, err := ioutil.ReadAll(f)
log.PanicIf(err)
exifData, err := exif.SearchAndExtractExif(data)
// fmt.Println(string(exifData))
if err != nil {
if err == exif.ErrNoExif {
fmt.Printf("EXIF data not found.\n")
os.Exit(-1)
}
panic(err)
}
// fmt.Println(exifData)
// Run the parse.
im := exif.NewIfdMappingWithStandard()
ti := exif.NewTagIndex()
visitor := func(fqIfdPath string, ifdIndex int, tagId uint16, tagType exif.TagType, valueContext exif.ValueContext) (err error) {
ifdPath, err := im.StripPathPhraseIndices(fqIfdPath)
log.PanicIf(err)
fmt.Println(ifdPath, tagId)
it, err := ti.Get(ifdPath, tagId)
if err != nil {
if log.Is(err, exif.ErrTagNotFound) {
fmt.Printf("WARNING: Unknown tag: [%s] (%04x)\n", ifdPath, tagId)
return nil
} else {
panic(err)
}
}
valueString := ""
if tagType.Type() == exif.TypeUndefined {
value, err := exif.UndefinedValue(ifdPath, tagId, valueContext, tagType.ByteOrder())
if log.Is(err, exif.ErrUnhandledUnknownTypedTag) {
valueString = "!UNDEFINED!"
} else if err != nil {
panic(err)
} else {
fmt.Println("111111")
valueString = fmt.Sprintf("%v", value)
}
} else {
valueString, err = tagType.ResolveAsString(valueContext, true)
fmt.Println("2222222")
fmt.Println(valueString)
if err != nil {
panic(err)
}
}
fmt.Printf("FQ-IFD-PATH=[%s] ID=(0x%04x) NAME=[%s] COUNT=(%d) TYPE=[%s] VALUE=[%s]\n", fqIfdPath, tagId, it.Name, valueContext.UnitCount, tagType.Name(), valueString)
return nil
}
_, err = exif.Visit(exif.IfdStandard, im, ti, exifData, visitor)
log.PanicIf(err)
}
from go-exif.
I use libexif in mac os and we could get the exif metadata,
Longitude: 106, 52, 58.850
But when we use go-exif , we got
FQ-IFD-PATH=[IFD/GPSInfo] ID=(0x0004) NAME=[GPSLongitude] COUNT=(3) TYPE=[RATIONAL] VALUE=[106/1]
from go-exif.
Try again, please.
from go-exif.
No response. Should be resolved, anyway.
from go-exif.
Related Issues (20)
- Alternatives to "no exif data" HOT 1
- isPrintableText() seems to return false if string contains \n or \r HOT 15
- Getting 0x01000000 value for SceneType instead of 0x00000001 HOT 1
- webp support? HOT 2
- Collect goes into an infinite loop for certain exif data HOT 3
- 100% CPU usage when parsing JPEG Exif HOT 6
- throw panic "no such file or directory" even if file exist HOT 3
- Can you tag with a Go Modules compatible version tag? HOT 8
- Use of panic when we could be passing along the error HOT 1
- Load EXIF without reading the entire file HOT 4
- Read all EXIF tags in file HOT 1
- can't read EXIF 0220 or EXIF 0221 version GPS information HOT 3
- Thumbnail offset gets corrupted when updating a tag HOT 1
- Re-reading data written from a list with A301 scene info causes crashes/ HOT 2
- How do you set an image.Image DPI? HOT 4
- building exif-read-tool fail... HOT 1
- ErrUnparseableValue error when reading in a JPEG file taken with a Sony digital camera HOT 4
- unparseable undefined tag - Reloaded HOT 1
- Out of memory when parsing a large file(4G) HOT 2
- Update README for JSON flag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-exif.