rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
640 stars 135 forks source link

Adds mknote package #12

Closed rwcarlsen closed 11 years ago

rwcarlsen commented 11 years ago

Thanks @gsadams!

rwcarlsen commented 11 years ago

Usage example:

    ...
    f, err := os.Open(fname)
    if err != nil {
        log.Fatal(err)
    }

    x, err := exif.Decode(f)
    if err != nil {
        log.Fatal(err)
    }

    _, err := mknote.Decode(x)
    if err != nil {
        log.Fatal(err)
    }

    owner, _ := x.Get(mknote.OwnerName)
    ...
rwcarlsen commented 11 years ago

Except it needs a better name than DecodeFile.

gsadams commented 11 years ago

I added a commit to the pull request I started, #11 , to do registration as I described. I'm not completely happy with the several conversions that it takes to add to the list of valid fields, but I suppose it's not too terrible. That could be reworked a bit at some point.

rwcarlsen commented 11 years ago

I think the validField check should probably just be removed. If we allow exif package users to load custom fields into the exif structure anyway (LoadDirTags), than anything could be a valid field.