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.6.5

Published by cshum almost 3 years ago

  • fix(vips): use vips_replicate for watermark repeat
  • fix(imagor): resolve suppressing context.Canceled
imagor - v0.6.4

Published by cshum almost 3 years ago

  • fix(vips): fit-in fill handling with unspecified width/height
  • fix(vips): no_upscale handling for stretch
  • fix(vips): resize upscale handling with unspecified width/height
imagor - v0.6.3

Published by cshum almost 3 years ago

  • feat(imagorpath): custom shouldEscape func for imagorpath.Normalize
  • feat: add config -file-safe-chars and -s3-safe-chars
imagor - v0.6.1

Published by cshum almost 3 years ago

feat(vips): add padding support for resize and stretch

imagor - v0.5.17

Published by cshum almost 3 years ago

Introducing Result Loader and Storage, where the image processing result can also be loaded/saved, in additional to the original image:

Docker Compose Example

Imagor with File Loader and Storage using mounted volume:

version: "3"
services:
  imagor:
    image: shumc/imagor:latest
    volumes:
      - ./:/mnt/data
    environment:
      PORT: 8000
      IMAGOR_UNSAFE: 1 # unsafe URL for testing
      
      FILE_LOADER_BASE_DIR: /mnt/data # enable file loader by specifying base dir
      FILE_STORAGE_BASE_DIR: /mnt/data # enable file storage by specifying base dir
      
      FILE_RESULT_LOADER_BASE_DIR: /mnt/data/result # enable file result loader by specifying base dir
      FILE_RESULT_STORAGE_BASE_DIR: /mnt/data/result # enable file result storage by specifying base dir
    ports:
      - "8000:8000"

Imagor with AWS S3 Loader and Storage:

version: "3"
services:
  imagor:
    image: shumc/imagor:latest
    environment:
      PORT: 8000
      IMAGOR_SECRET: mysecret # secret key for URL signature
      AWS_ACCESS_KEY_ID: ...
      AWS_SECRET_ACCESS_KEY: ...
      AWS_REGION: ...
      
      S3_LOADER_BUCKET: mybucket # enable S3 loader by specifying loader bucket
      S3_LOADER_BASE_DIR: images # optional
      S3_STORAGE_BUCKET: mybucket # enable S3 storage by specifying storage bucket
      S3_STORAGE_BASE_DIR: images # optional
      
      S3_RESULT_LOADER_BUCKET: mybucket # enable S3 result loader by specifying loader bucket
      S3_RESULT_LOADER_BASE_DIR: images/result # optional
      S3_RESULT_STORAGE_BUCKET: mybucket # enable S3 result loader by specifying loader bucket
      S3_RESULT_STORAGE_BASE_DIR: images/result # optional
    ports:
      - "8000:8000"
  • feat(imagor): result loader and storage
  • fix(imagor) processor singleflight to neglect meta/ from key
  • fix(imagor): ProcessTimeout context.DeadlineExceeded should return ErrTimeout
  • fix(imagor): VIPS_INTERESTING_LOW and VIPS_INTERESTING_HIGH mapping with mixed HAlign VAlign
  • fix(imagor): timeout handling for call suppression mechanism
  • fix(imagor): file path escape handling
  • feat(imagorpath): add func imagorpath.Escape(string) string
  • feat(vips): update govips and error message wrapper
  • feat(server): add RunContext
  • feat(vips): use vips thumbnail for rotation
  • feat(vips): optimize get VIPS_META_LOADER
  • fix(vips): fix filters background_color with no alpha and fill auto
  • refactor(imagor): rename File.Bytes to File.ReadAll
  • refactor(imagorpath): rename imagorpath.Escape to imagorpath.Normalize
imagor - v0.5.4

Published by cshum almost 3 years ago

  • feat(imagor): imagor processor call suppression
  • feat(imagor): add option -imagor-process-timeout
imagor - v0.5.3

Published by cshum almost 3 years ago

Imagor 0.5 onwards revamp file I/O and leverages vips_thumbnail_buffer and vips_thumbnail where possible and using native file sniffing from libvips. These improve I/O performance, especially for file loader and storage.

  • feat(vips) revamp vips thumbnail construction to support both file and buffer
  • feat(vips) added option -vips-max-width -vips-max-height
  • fix(imagor) fix nil pointer dereference on empty response cases
  • feat(vips) add option -vips-load-from-file
imagor - v0.3.5

Published by cshum almost 3 years ago

Imagor 0.3.2 now leverages shrink-on-load whenever possible #9 , and migrated all resize operations using vips_thumbnail_image and vips_thumbnail_buffer. This should result performance boost for fit-in, stretch and resize operations with given width and height parameters beforehand.

However, when crop or trim is used, shrink-on-load needs to be disabled to remain feature parity. An option is to proceed trim() inside the filters: pipeline if this is allowed for your use case, such that shrink-on-load can also be leveraged.

  • feat(vips): optimize thumbnail operations by combining open and resize where possible
  • feat(vips) restructure all resize operations with vips_thumbnail_image and vips_thumbnail_buffer
  • feat(vips) restructure fill color using vips_embed extend background and vips_flatten
  • feat(imagor): -imagor-cache-header-ttl -1 for no-cache
  • fix(govips): fix vips_embed extend background potential memory leak
  • fix(govips): use vips-loader metadata to determine image type
imagor - v0.2.11

Published by cshum almost 3 years ago

  • feat(server): add access log handler
  • feat(httploader): add gzip handling
  • fix(imagor): loader timeout to return ErrTimeout
  • fix(vips): rename option -vips-concurrency-level to -vips-concurrency
  • feat(s3store): add -s3-endpoint option
  • feat(vips): option -vips-concurrency-level=-1 to be the number of CPU cores