https://github.com/abrander/apexif
Go package for reading EXIF data from various image formats
https://github.com/abrander/apexif
exif exif-reader go golang
Last synced: over 1 year ago
JSON representation
Go package for reading EXIF data from various image formats
- Host: GitHub
- URL: https://github.com/abrander/apexif
- Owner: abrander
- License: mit
- Created: 2023-05-18T06:26:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T12:08:34.000Z (over 2 years ago)
- Last Synced: 2024-11-26T13:11:49.380Z (over 1 year ago)
- Topics: exif, exif-reader, go, golang
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apexif
[](https://pkg.go.dev/github.com/abrander/apexif)
This is a simple Go package for reading EXIF data from various file
formats. It's build for speed and simplicity. The package does not
have any dependencies.
All data must be loaded in memory (or mmapped) before calling `Identify()`.
### Supported file formats
- [x] CR2
- [x] CRW
- [x] HEIC
- [x] JPEG
- [x] PNG
- [x] TIFF
- [x] WebP
#### Supported container types
- [x] ISOBMFF (MPEG-4 Part 12)
- [x] RIFF
- [x] TIFF
These are not file formats and only interesting for developers of
this package.
### Usage example
```go
package main
import (
"fmt"
"os"
"github.com/abrander/apexif"
)
func main() {
data, err := os.ReadFile("example.jpeg")
if err != nil {
panic(err)
}
f, err := apexif.Identify(data)
if err != nil {
panic(err)
}
fmt.Printf("Yay. We got a %s image.\n", f.Name())
e, err := f.Exif()
if err != nil {
panic(err)
}
make, _ := e.Make()
fmt.Printf("The image was captured by a %s camera.\n", make)
}
```
### License
This package is licensed under the MIT license. See LICENSE for details.