imagor

Fast, secure image processing server and Go library, using libvips

APACHE-2.0 License

Stars
3.2K
Committers
22

Bot releases are visible (Hide)

imagor - v0.8.29

Published by cshum over 2 years ago

Stability Release

  • fix(imagor): empty bytes handling
  • perf: improve bytes content-type determination
  • fix(vips): find trim fail should not disrupt image operations
  • fix(imagor): emtpy image key handling
  • fix(imagor): empty filter arg handling
  • improved test coverage

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.28...v0.8.29

imagor - v0.8.28

Published by cshum over 2 years ago

Cache-Control Header Options

New options for Cache-Control header - stale-while-revalidate and no-cache support

  -imagor-cache-header-swr duration
        Imagor HTTP Cache-Control header stale-while-revalidate for successful image response (default 24h0m0s)
  -imagor-cache-header-no-cache
        Imagor HTTP Cache-Control header no-cache for successful image response

What's Changed

  • feat(imagor): Cache-Control header stale-while-revalidate support by @cshum in https://github.com/cshum/imagor/pull/63
  • fix(vips): crop with trim handling
  • fix(vips): focal filter with crop
  • feat(imagor): http HEAD method support
  • fix(imagor): fix avif load error

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.23...v0.8.28

imagor - v0.8.23

Published by cshum over 2 years ago

Filter focal(AxB:CxD)

Adds a focal region for custom transformation, coordinated by left-top point AxB and right-bottom point CxD.
Also accepts float values between 0 and 1 that represents percentage of image dimensions.

http://localhost:8000/unsafe/200x50/smart/filters:fill(white)/https://raw.githubusercontent.com/cshum/imagor/master/testdata/gopher.png
http://localhost:8000/unsafe/200x50/smart/filters:fill(white):focal(589x401:1000x814)/https://raw.githubusercontent.com/cshum/imagor/master/testdata/gopher.png
http://localhost:8000/unsafe/200x50/smart/filters:fill(white):focal(0.35x0.25:0.6x0.3)/https://raw.githubusercontent.com/cshum/imagor/master/testdata/gopher.png

gopher gopher (1) gopher (2)

What's Changed

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.22...v0.8.23

imagor - v0.8.22

Published by cshum over 2 years ago

Filter max_bytes(amount)

Automatically degrades the quality of the image until the image is under the specified amount of bytes

Improved Memory Control

Improved memory control using jemalloc

What's Changed

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.20...v0.8.22

imagor - v0.8.20

Published by cshum over 2 years ago

Improved GIF Performance

Imagor Docker now adopts cgif library for GIF Save in libvips , resulting faster export speed and significantly reduced memory usage.

What's Changed

  • build: cgif 0.3.0, govips 2.11.0
  • build: remove magick
  • refactor: MaxFilterOps default unlimited
  • refactor(imagor): blob type handling

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.18...v0.8.20

imagor - v0.8.18

Published by cshum over 2 years ago

PDF Thumbnail Support

Imagor now supports generating PDF Thumbnail. Example:

http://localhost:8000/unsafe/fit-in/200x200/filters:fill(cyan)/http://www.africau.edu/images/default/sample.pdf

Config File

Configuration may be specified in a .env configuration file and referenced with the -config flag.

PORT=8000
IMAGOR_SECRET=mysecret
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=...
imagor -config path/to/config.env
imagor -config path/to/config.env

What's Changed

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.17...v0.8.18

imagor - v0.8.17

Published by cshum over 2 years ago

Experimental AVIF Conversion

Output AVIF format automatically if browser supports, based on Accept request header check for image/avif (thanks @lorenries)

  -imagor-auto-avif
        Output Avif format automatically if browser supports

However AVIF encoder at this stage is very slow and image size is not optimal compare to the WebP counterpart.

GitHub Container Registry

Starting from v0.8.17, Imagor Docker image is now available at Github Container Registry with multi-CPU architecture support.

Quick Start

docker run -p 8000:8000 ghcr.io/cshum/imagor:v0.8.17 -imagor-unsafe -imagor-auto-webp

What's Changed

New Contributors

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.16...v0.8.17

imagor - v0.8.16

Published by cshum over 2 years ago

Automatic WebP Conversion

Output WebP format automatically if browser supports, based on Accept request header check for image/webp

  -imagor-auto-webp
        Output WebP format automatically if browser supports

Base Path Redirect URL

Ability to configure URL for redirection on base path /

  -imagor-base-path-redirect string
        URL to redirect for Imagor / base path e.g. https://www.google.com

What's Changed

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.15...v0.8.16

imagor - v0.8.15

Published by cshum over 2 years ago

Google Cloud Storage Support

Imagor now supports Google Cloud Storage for Loader, Storage and Result Storage (thanks @srlk).

Docker Compose Example

version: "3"
services:
  imagor:
    image: shumc/imagor:latest
    volumes:
      - ./googlesecret:/etc/secrets/google
    environment:
      PORT: 8000
      IMAGOR_SECRET: mysecret # secret key for URL signature
      GOOGLE_APPLICATION_CREDENTIALS: /etc/secrets/google/appcredentials.json # google cloud secrets file

      GCLOUD_LOADER_BUCKET: mybucket # enable loader by specifying bucket
      GCLOUD_LOADER_BASE_DIR: images # optional

      GCLOUD_STORAGE_BUCKET: mybucket # enable storage by specifying bucket
      GCLOUD_STORAGE_BASE_DIR: images # optional

      GCLOUD_RESULT_STORAGE_BUCKET: mybucket # enable result storage by specifying bucket
      GCLOUD_RESULT_STORAGE_BASE_DIR: images/result # optional
      GCLOUD_RESULT_STORAGE_ACL: publicRead # optional - see https://cloud.google.com/storage/docs/json_api/v1/objects/insert
    ports:
      - "8000:8000"

What's Changed

New Contributors

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.12...v0.8.15

imagor - v0.8.12

Published by cshum over 2 years ago

Crop params in percentage

Imagor now supports cropping image by percentage float params. Useful for cropping image when image size is not known beforehand. (thanks @pletessier )

Example:

http://localhost:8000/unsafe/0.1x0.2:0.8x0.9/filters:fill(cyan)/raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif

dancing-banana

What's Changed

  • Crop params in percentage by @pletessier in https://github.com/cshum/imagor/pull/28
  • feat(vips): float support for watermark position
  • fix(vips): crop animated height handling and cleanup
  • fix(imagor): neglect warn log for result loader error

New Contributors

Full Changelog: https://github.com/cshum/imagor/compare/v0.8.10...v0.8.12

imagor - v0.8.10

Published by cshum over 2 years ago

Expiration support for File & S3, Storage & Result Storage

New configuration options:

  -file-storage-expiration duration
        File Storage expiration duration e.g. 24h. Default no expiration
  -file-result-storage-expiration duration
        File Result Storage expiration duration e.g. 24h. Default no expiration
  -s3-storage-expiration duration
        S3 Storage expiration duration e.g. 24h. Default no expiration
  -s3-result-storage-expiration duration
        S3 Result Storage expiration duration e.g. 24h. Default no expiration

Changes

  • feat(storage): s3 and file storage expiration support
  • refactor(imagorpath): Normlize add escapeByte func
  • build: update govips
imagor - v0.8.9

Published by cshum over 2 years ago

Animation support for repeated watermarks

Example

http://localhost:8000/unsafe/fit-in/200x150/filters:fill(cyan):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif,repeat,bottom,0,40,40)/raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif

dancing-banana (6)

Changes

  • feat(vips): animated repeated watermark support
  • feat(imagor): imagor process concurrency semaphore
  • feat(vips): new proportion(percentage) filter
  • feat(vips): new crop(top,left,right,bottom) filter
  • fix(imagor) IsPNG should call readAllOnce
  • feat: add s3 force path style option
  • fix(imagor): move semaphore before load storage
imagor - v0.8.6

Published by cshum over 2 years ago

Introducing frames filter

  • frames(n[, delay]) set the number of frames to repeat for animation with gif or webp. Otherwise, stack all the frames vertically
    • n number of frames to repeat
    • delay frames delay in milliseconds, default 100

Frames filter allows you to control number of frames and animation speed. It also allows animating a static image in conjunction with a gif watermark. Example:

http://localhost:8000/unsafe/fit-in/200x200/filters:fill(white):frames(8,150):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif,center,bottom):format(gif)/raw.githubusercontent.com/cshum/imagor/master/testdata/gopher.png

gopher

Changes

  • feat(vips): frames filter
  • fix(vips): watermark missing args
  • build: update vips to v8.12.2
imagor - v0.8.5

Published by cshum over 2 years ago

  • feat(vips): added animated watermark support
  • feat(vips): aded left-top and right-bottom padding support, using the new URL syntax GxH:IxJ

Example:

http://localhost:8000/unsafe/300x0/0x20:100x20/filters:fill(yellow):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif,-30,10,0,50,50):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif,-10,-10,0,50,50)/raw.githubusercontent.com/cshum/imagor/master/testdata/nyan-cat.gif

nyan-cat

imagor - v0.8.1

Published by cshum over 2 years ago

Introducing Animation Support

Imagor is rewritten to support animation for various common operations. The maximum of animated image frames can be configured using cli arguments:

 -vips-max-animation-frames int
        VIPS maximum of animated image frames to be processed. Set 1 to disable animation, -1 for unlimited. (default -1)

original image

https://raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif

dancing-banana

fit-in, fill and watermark example:

http://localhost:8000/unsafe/fit-in/200x150/filters:fill(yellow):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/gopher-front.png,repeat,bottom,0,40,40)/raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif

dancing-banana

crop and fill example:

http://localhost:8000/unsafe/30x40:100x150/filters:fill(cyan)/raw.githubusercontent.com/cshum/imagor/master/testdata/dancing-banana.gif

dancing-banana (2)

imagor - v0.7.6

Published by cshum almost 3 years ago

  • feat(httploader): added -http-loader-accept for setting and validating request Accept header
  • fix(imagor) load error should not save
imagor - v0.7.5

Published by cshum almost 3 years ago

HTTP Loader Proxy

Imagor HTTP Loader now added proxy support, which can be configured using cli arguments:

  -http-loader-proxy-urls string
        HTTP Loader Proxy URLs. Enable HTTP Loader proxy only if this value present. Accept csv of proxy urls e.g. http://user:pass@host:port,http://user:pass@host:port
  -http-loader-proxy-allowed-sources string
        HTTP Loader Proxy allowed hosts that enable proxy transport, if proxy URLs are set. Accept csv wth glob pattern e.g. *.google.com,*.github.com.

or using environment variables:

HTTP_LOADER_PROXY_URLS=http://user:pass@host:port,http://user:pass@host:port
HTTP_LOADER_PROXY_ALLOWED_SOURCES=*.google.com,*.github.com
  • feat(httploader): HTTP Loader Proxy
  • refactor(vips): optimize resize with unspecified width or height
  • fix(imagorpath): padding bound against image dimension
  • refactor(vips): locking mechanism for image refs tracker
imagor - v0.7.2

Published by cshum almost 3 years ago

  • refactor: refine Loader, Saver and Storage interfaces
  • build: update govips
imagor - v0.7.1

Published by cshum almost 3 years ago

  • fix(vips): fix GC/memory concurrent edge case on watermark filter
  • refactor(vips): context based image ref handler
imagor - v0.7.0

Published by cshum almost 3 years ago

  • feat(cmd): reuse storage config for loader
  • refactor(cmd): cleanup result loader config
  • refactor(imagor) simplify Storage interface
  • fix(imagor): context canceled handling
  • feat(imagor): optimize Blob buffer IO