Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/endlesstravel/goheif
fork && try fix go mod from https://github.com/jdeng/goheif/
https://github.com/endlesstravel/goheif
Last synced: 13 days ago
JSON representation
fork && try fix go mod from https://github.com/jdeng/goheif/
- Host: GitHub
- URL: https://github.com/endlesstravel/goheif
- Owner: endlesstravel
- Created: 2023-03-20T16:29:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-03-20T16:30:35.000Z (over 1 year ago)
- Last Synced: 2024-10-27T05:51:29.754Z (17 days ago)
- Language: Go
- Size: 690 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fork && try fix go mod from https://github.com/jdeng/goheif/
# GoHeif - A go gettable decoder/converter for HEIC based on libde265
## Install
- `heic2jpg` to convert HEIC files to JPG preserving exif``` go get github.com/endlesstravel/goheif/...```
- Tested
- Mac OS X (High Sierra)
- Linux (Ubuntu 16.04 / GCC 5.4)
- Windows 7 64bit with TDM-GCC 32 (GCC 5.1) and golang 1.12 windows/386- Code Sample
```
func main() {
flag.Parse()
...
fin, fout := flag.Arg(0), flag.Arg(1)
fi, err := os.Open(fin)
if err != nil {
log.Fatal(err)
}
defer fi.Close()exif, err := goheif.ExtractExif(fi)
if err != nil {
log.Printf("Warning: no EXIF from %s: %v\n", fin, err)
}img, err := goheif.DecodeImage(fi)
if err != nil {
log.Fatalf("Failed to parse %s: %v\n", fin, err)
}fo, err := os.OpenFile(fout, os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
log.Fatalf("Failed to create output file %s: %v\n", fout, err)
}
defer fo.Close()w, _ := newWriterExif(fo, exif)
err = jpeg.Encode(w, img, nil)
if err != nil {
log.Fatalf("Failed to encode %s: %v\n", fout, err)
}log.Printf("Convert %s to %s successfully\n", fin, fout)
}
```## What is done
- Changes make to @bradfitz's (https://github.com/bradfitz) golang heif parser
- Some minor bugfixes
- A few new box parsers, noteably 'iref' and 'hvcC'- Include libde265's source code (SSE by default enabled) and a simple golang binding
- A Utility `heic2jpg` to illustrate the usage.
## License
- heif and libde265 are in their own licenses
- goheif.go, libde265 golang binding and the `heic2jpg` utility are in MIT license
## Credits
- heif parser by @bradfitz (https://github.com/go4org/go4/tree/master/media/heif)
- libde265 (https://github.com/strukturag/libde265)
- implementation learnt from libheif (https://github.com/strukturag/libheif)## TODO
- Upstream the changes to heif?