A thumbnailing library for Go. https://code.ivysaur.me/thumbnail/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
mappu 69a48a82b9 doc: update README for v1.0.2 release 6 months ago
cmd/mkthumb cmd/mkthumb: rename to main.go, remove pointless makefile 6 months ago
.gitignore hg2git: convert ignores/tags files 2 years ago
CachingThumbnailer.go add RenderFileAs() for user-supplied mime-type 2 years ago
DirectThumbnailer.go add RenderFileAs() for user-supplied mime-type 2 years ago
README.md doc: update README for v1.0.2 release 6 months ago
Thumbnailer.go add RenderFileAs() for user-supplied mime-type 2 years ago
config.go scaler: support Stretch 2 years ago
decodeImage.go major refactor - add png(noncrush),bmp thumbnail output 2 years ago
decodeVideo.go major refactor - add png(noncrush),bmp thumbnail output 2 years ago
go.mod vendor: update other libraries (hashicorp/golang-lru and golang.org/x/image) 6 months ago
go.sum vendor: update other libraries (hashicorp/golang-lru and golang.org/x/image) 6 months ago
imagecrush_cgo.go pngcrush: update to v2.12.6 with fixed v2 module handling; automatically handle build tags based on cgo availability 6 months ago
imagecrush_nocgo.go pngcrush: update to v2.12.6 with fixed v2 module handling; automatically handle build tags based on cgo availability 6 months ago
make_archive.sh make_archive: update to exclude vendor dir from release tarballs 2 years ago
scaler.go scaler: support Stretch 2 years ago

README.md

thumbnail

A thumbnailing library for Go.

  • Supports jpeg / png / gif / bmp / webp files (internally)
  • Supports video files (requires ffmpeg in $PATH)
  • Optional LRU cache of recent thumbnails for performance
  • Sampling algorithms: Nearest-neighbour, Bilinear (fast), Bilinear (accurate), Bicubic (Catmull-Rom)
  • Scaling algorithms: Fit inside, Fit outside, Stretch
  • Output formats: JPG, PNG, Quantised/lossy PNG (via go-imagequant if CGO is available), BMP

A standalone binary mkthumb is provided as a sample utility.

This package can be installed via go get: go get code.ivysaur.me/thumbnail

Changelog

2020-07-25 1.0.2

  • Automatically build pngquant support if CGO is available
  • Remove vendor directory, rely more heavily on Go Modules
  • Update module dependencies

2018-12-31 1.0.1

  • Convert to Go Modules
  • Update vendored dependencies

2018-06-09 1.0.0

  • Feature: Major speed improvement
  • Feature: Support FitInside, FitOutside, and Stretch stretching modes
  • Feature: Support Bilnear (Fast), Bilnear (Accurate), and Bicubic (Catmull-Rom) scaling algorithms
  • Feature: Support PNG output without imagequant; support BMP output
  • Feature: Support Webp and BMP input files
  • Fix wrong dimension output for video input files
  • Fix jagged output of bilinear resizer
  • ⬇️ thumbnail-1.0.0-src.tar.xz (4.78 KiB)

2018-06-04 0.2.1

2017-11-18 0.2.0

  • Initial standalone release
  • Feature: Decode input with specified mime type
  • Feature: Allow passing zero as thumbnail cache size
  • ⬇️ thumbnail-0.2.0-src.zip (23.37 KiB)

2017-01-03 0.1.0

  • Version of thumbnail vendored with webdir 1.0 (previously tagged as release-1.0)