Skip to content
/ exif-web Public

Lightweight Opensource Exif Analytic Backend written in Golang, support Restful API, WebUI, x86, ARM, Linux, macOS.

License

Notifications You must be signed in to change notification settings

zjc17/exif-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exif Web

CodeQL codecov Security Scan Release Go Report Card Docker Image

FeaturesDownloadDemoUsageFutureConfigurationCredit

ENGLISH | 中文文档

Lightweight Opensource Exif Analytic Backend written in Golang, with binary size < 15MB.

Support Restfull API, WebUI, x86, ARM, Linux, macOS.

Features

  • 🏎️ Utilized fastest and wildly used EXIF Javascript lib.
  • 📷 Files: .jpg, .tif, .png, .heic, .avif, .iiq
  • 📑 Reads only first few bytes for a given url or image data.
  • 🗜️ Easy to deploy: one cross-platform binary file or docker to deploy.
  • Lightweight cache / persistent storage by sqlite.

Download

Download the binaries for your system and architecture from the releases page.

If you use docker, you can use the following command (Dockerhub)

docker pull lovecho/exif-web:latest

Demo

You can also check the live demo here exif.gotool.tech

Usage

Use default parameters launch the api server:

./exif-web

WebUI Usage

After start exif-web, open the webui at localhost:8080, then

  • upload you local image
  • or parse remote image by Restful API

Restful API Usage

Parse a remote image with its uri

curl 'http://127.0.0.1:8080/api/v1/parse?url=$IMAGE_URL'

Docker Usage

There is no difference between using parameters in Docker and the above, for example, we start a Web UI formatting tool service in Docker:

docker run --rm -it -p 8080:8080 lovecho/exif-web:latest

Docker Compose

You can find the docker-compose.yml file at docker/docker-compose.yml in project.

Feel free to customise it.

As an external library

Install dependency

go get github.com/zjc17/exif-web
package main

import (
	"fmt"
	"github.com/zjc17/exif-web/pkg/fetcher"
	"github.com/zjc17/exif-web/pkg/parser"
)

func main() {
	url := ""
	image, _ := fetcher.GetImagePartial(url, nil)
	p := parser.NewParser()
	result, _ := p.Parse(image)
	fmt.Printf("%+v", result)
}

Future

  • Support read image on local filesystem
  • A simple web ui as live demo
  • A simple built-in k/v caching system to prevent duplication of parsing

Configuration

Environment variables:

Name Default Description
EXIF_WEB_SQLITE_PATH /tmp/exif-web.sqlite3 sqlite file path

Credit

Exif parse components:

  • exifr: The fastest and most versatile JavaScript EXIF reading library, under [MIT license]
  • modified javascript version for golang execution, under [Apache-2.0 license], 28/04/2023:

Runtime dependent components:

  • goja: ECMAScript 5.1(+) implementation in Go, under [MIT license].

Web components:

  • Gin: a HTTP web framework written in Go (Golang), under [MIT license]

WebUI components:

  • Crayons: A UI Kit comprising of web components for building Freshworks Apps! - [License not specified yet]

About

Lightweight Opensource Exif Analytic Backend written in Golang, support Restful API, WebUI, x86, ARM, Linux, macOS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published