Pure Go ExifTool wrapper powered by WebAssembly.
Uses zeroperl (Perl compiled to WebAssembly) and wazero (pure Go WebAssembly runtime) to provide ExifTool functionality without any external dependencies.
- Pure Go: No CGO required, easy cross-compilation
- Single Binary: WebAssembly module is embedded, distributable as a single binary
- Full ExifTool: Uses the real ExifTool (v13.42), supporting all metadata formats (EXIF, IPTC, XMP, ICC, etc.)
- No External Dependencies: No need to install Perl or ExifTool on the system
Download binary from Releases
or
go install github.com/yashikota/exiftool-go@latest# Read metadata
exiftool-go photo.jpg
# JSON output
exiftool-go -json photo.jpg
# Multiple files
exiftool-go photo1.jpg photo2.jpggo get github.com/yashikota/exiftool-gopackage main
import (
"fmt"
"log"
"github.com/yashikota/exiftool-go/pkg/exiftool"
)
func main() {
// Create ExifTool instance
et, err := exiftool.New()
if err != nil {
log.Fatal(err)
}
defer et.Close()
// Read metadata from image
metadata, err := et.ReadMetadata("photo.jpg")
if err != nil {
log.Fatal(err)
}
// Print metadata
for key, value := range metadata {
fmt.Printf("%s: %v\n", key, value)
}
}-
New() (*ExifTool, error)Creates a new ExifTool instance. Call Close when done.
-
NewWithContext(ctx context.Context) (*ExifTool, error)Creates a new ExifTool instance with the given context.
-
(*ExifTool) Close() errorReleases all resources associated with the ExifTool instance.
-
(*ExifTool) Version() (string, error)Returns the ExifTool version string.
-
(*ExifTool) ReadMetadata(filePath string) (map[string]any, error)Reads metadata from an image file and returns it as a map.
-
(*ExifTool) WriteMetadata(srcPath string, dstPath string, tags map[string]any) errorWrites multiple tags to an image file. If dstPath is empty, the source file is modified in place.
-
(*ExifTool) SetTag(srcPath string, dstPath string, tag string, value string) errorWrites a single tag to an image file. If dstPath is empty, the source file is modified in place.
- zeroperl: Compiles Perl 5 interpreter to WebAssembly with WASI support
- wazero: Provides a pure Go WebAssembly runtime
- ExifTool: Perl module (Image::ExifTool) is bundled in zeroperl's WebAssembly binary
- This library: Wraps everything in a clean Go API