Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corona10/goimghdr
The imghdr module determines the type of image contained in a file for go
https://github.com/corona10/goimghdr
go imghdr
Last synced: 18 days ago
JSON representation
The imghdr module determines the type of image contained in a file for go
- Host: GitHub
- URL: https://github.com/corona10/goimghdr
- Owner: corona10
- License: bsd-3-clause
- Created: 2018-02-25T09:34:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-14T10:13:28.000Z (over 5 years ago)
- Last Synced: 2024-11-25T23:03:52.757Z (26 days ago)
- Topics: go, imghdr
- Language: Go
- Homepage:
- Size: 442 KB
- Stars: 40
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - goimghdr - The imghdr module determines the type of image contained in a file for Go. (Images / Search and Analytic Databases)
- awesome-go-extra - goimghdr - 02-25T09:34:44Z|2019-06-14T10:13:28Z| (Images / Advanced Console UIs)
README
[![Build Status](https://travis-ci.org/corona10/goimghdr.svg?branch=master)](https://travis-ci.org/corona10/goimghdr)
[![GoDoc](https://godoc.org/github.com/corona10/goimghdr?status.svg)](https://godoc.org/github.com/corona10/goimghdr)
[![Go Report Card](https://goreportcard.com/badge/github.com/corona10/goimghdr)](https://goreportcard.com/report/github.com/corona10/goimghdr)
[![Coverage Status](https://coveralls.io/repos/github/corona10/goimghdr/badge.svg?branch=coverall)](https://coveralls.io/github/corona10/goimghdr?branch=coverall)# goimghdr
> Inspired by Python's [imghdr](https://docs.python.org/3/library/imghdr.html)## Installation
```
go get github.com/corona10/goimghdr
```## List of return value
| Value | Image format |
|--------|-----------------------------------|
| "rgb" | SGI ImgLib Files |
| "gif" | GIF 87a and 89a Files |
| "pbm" | Portable Bitmap Files |
| "pgm" | Portable Graymap Files |
| "ppm" | Portable Pixmap Files |
| "tiff" | TIFF Files |
| "rast" | Sun Raster Files |
| "xbm" | X Bitmap Files |
| "jpeg" | JPEG data in JFIF or Exif formats |
| "bmp" | BMP files |
| "png" | Portable Network Graphics |
| "webp" | WebP files |
| "exr" | OpenEXR Files |## Usage
[example](examples/example.go)
[![asciicast](https://asciinema.org/a/zfh9TERizU7RcSAxXo9ioKQq4.png)](https://asciinema.org/a/zfh9TERizU7RcSAxXo9ioKQq4)
## Special thanks to
* [Haeun Kim](https://github.com/haeungun/)## Reference
* [CPython imghdr module](https://docs.python.org/3/library/imghdr.html)
* [DSCN0029.jpg](imgData/DSCN0029.jpg) is from [ianare/exif-samples](https://github.com/ianare/exif-samples)