Pical is an on-the-fly image manipulation application. It uses sharp for image manipulation application.
docker run -d -p 8080:8080 pical/picalUnsigned URL
<domain>/p/<path>@<format>?<query>
Signed URL
<domain>/s/<signature>/<path>@<format>?<query>
- signature: Add
PICAL_KEYto the start of/<path>@<format>?<query>and calculate the HMAC digest using SHA256, and encode the first 32 bytes result with URL-safe Base64.@pical/signaturecan be used to generate the signature. - path: Path of the image. It is the relative path from the base directory if it is using local storage. It is the relative path from the root directory if it is using S3 storage.
- format: Format of the output image. E.g.
png,jpg,webp.originalis supported without transformation. - query: Query string for pass parameter to sharp. E.g.
format[progressive]=true&resize[width]=300&greyscale=true. It is parsed by qs and it is passed by<method>[<parameter>](exceptformatis fortoFormat). Please refer to sharp documentation.
Pical can be configure by environment variable.
Default storage for Pical.
- PICAL_LOCAL_BASE_DIR: (Optional)
/databy default.
To enable S3 storage, PICAL_S3_END_POINT, PICAL_S3_BUCKET, PICAL_S3_ACCESS_KEY, and PICAL_S3_SECRET_KEY must be set.
- PICAL_S3_END_POINT: S3 Endpoint
- PICAL_S3_BUCKET: S3 Bucket
- PICAL_S3_ACCESS_KEY: S3 Access Key
- PICAL_S3_SECRET_KEY: S3 Secret Key
- PICAL_S3_USE_SSL: (Optional) Enable SSL connection to S3 endpoint.
trueby default. - PICAL_S3_PORT: (Optional) Port of the S3 Endpoint
- PICAL_S3_REGION: (Optional)
- PICAL_S3_SESSION_TOKEN: (Optional)
- PICAL_S3_PART_SIZE: (Optional)
- PICAL_KEY: Key for generating signature.
- PICAL_SALT: Salt for generating signature.
- NODE_ENV: (Optional)
productionby default. - PICAL_UNSAFE_PLAIN: (Optional) Allow unsigned url if it is set to
true.falseifNODE_ENVis set toproductionby default. - PICAL_PORT: (Optional)
8080by default. - PICAL_CACHE: (Optional)
max-ageheader.604800by default.