Git Product home page Git Product logo

Comments (7)

mysterytree avatar mysterytree commented on August 15, 2024

maybe value should be
image

from go-exif.

dsoprea avatar dsoprea commented on August 15, 2024

from go-exif.

mogita avatar mogita commented on August 15, 2024

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.

mysterytree avatar mysterytree commented on August 15, 2024

@dsoprea


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.

mysterytree avatar mysterytree commented on August 15, 2024

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.

dsoprea avatar dsoprea commented on August 15, 2024

Try again, please.

a30f27f

from go-exif.

dsoprea avatar dsoprea commented on August 15, 2024

No response. Should be resolved, anyway.

from go-exif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.