Sign inSign up

drvitaminc/imagereductor

By drvitaminc

Updated 2 days ago

Image delivery from storage of AWS S3 / GCS contents with Resizing and Caching

Image
0

50K+

drvitaminc/imagereductor repository overview

imagereductor

Image delivery from storage of AWS S3 / GCS contents with Resizing and Caching

URL Query Key to Resize

  • key : path of storage
  • w : 500 (px) | risizeing width with original aspect ratio
  • h : 500 (px) | risizeing height with original aspect ratio
  • q : 1 ~ 4 | change image quality
  • rotate : right,left,upsidedown,autovertical,autohorizontal | auto... are rotate image auto vertical / horizontal position
  • crop : 111,222,333,444 (from point x/y - to point x/y)
  • bri : 0 ~ 100 | change image brightness
  • cont : -100 ~ 100 | change image contrast
  • gam : 0.0 ~ | change image gamma
  • nonusecache: true

Form Key to Upload(multipart/form-data)

  • path : path of storage
  • uploadfile : filepath

Endpoint

Methodendpointusage
GET/Get image file using query options
POST/Upload image file with bearer token of authorization header
GET/filesGet non-image file using 'key' query option only
POST/filesUpload non-image file with bearer token of authorization header
GET/streamingGet non-image file using 'key' query option only with HTTP Streaming
GET/infoGet file (Content-Type / Content-Length) info using 'key' and 'nonusecache' query option only
GET/tokenGet bearer token (Only IP addresses restricted by TOKENAPI_ALLOW_IPS can be requested)

using docker

envparam
VERIFY_MODEenable / disable
LOG_MODEminimum / few or empty
ADMIN_MODEenable / disable
SERVER_PORT8080, 80, etc (When starting on port 80, specify root as the startup user.)
TOKENAPI_ALLOW_IPS72.22.0.1/24,127.0.0.1/32(separate with comma)
CACHE_TYPEredis / gocache
REDISHOSTx.x.x.x
REDISPORT6379
REDISTLSuse or empty
REDISPASSWORD
CACHEDDB0~
CACHEEXPIED300 (seconds)
HEADEREXPIRED300 (seconds)
STORAGE_TYPEs3 / gcs
AWS_S3_LOCALUSEskipverify or empty
AWS_S3_REGION
AWS_S3_BUKET
AWS_S3_ACCESSKEY
AWS_S3_SECRETKEY
AWS_S3_ENDPOINT(use with minio)
GCS_BUKET
GCS_PROJECTID
GOOGLE_APPLICATION_CREDENTIALS
TOKEN_SECRET(use with jwt token when upload images)
VALIDATE_IMAGE_TYPEjpeg,gif,png,bmp,tiff
VALIDATE_IMAGE_MAXWIDTH5000 (px)
VALIDATE_IMAGE_MAXHEIGHT5000 (px)
VALIDATE_IMAGE_MAXFILESIZE104857600 (byte)

Tag summary

Content type

Image

Digest

sha256:74eca5958

Size

32.3 MB

Last updated

2 days ago

docker pull drvitaminc/imagereductor