Sign inSign up

uqlibrary/vipsthumbnail

By uqlibrary

Updated about 4 years ago

Create image thumbnails using libvips

Image
0

100K+

uqlibrary/vipsthumbnail repository overview

docker-vipsthumbnail

This repository contains a Dockerfile of libvips for Docker's automated build published to the public Docker Hub Registry.

Installation
  1. Install Docker.

  2. Download the automated build from the public Docker Hub Registry: docker pull uqlibrary/vipsthumbnail

    (or, you can build an image from Dockerfile: `docker build -t uqlibrary/vipsthumbnail .)

Usage
docker run -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
           -v /tmp/my_libvips_tmp_dir:/tmp/libvips \
           uqlibrary/docker-libvips <STRING>${sourceBucket/key} <STRING>${targetBucket} <JSON_ARRAY>${vipsthumbnail_args}

For ${vipsthumbnail_args}, see http://libvips.github.io/libvips/API/current/Using-vipsthumbnail.md.html

Example
docker run -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
           -v /tmp/my_libvips_tmp_dir:/tmp/libvips \
           uqlibrary/docker-libvips s3:/mybucket/image.tiff s3:/mybucket \
           '[ \
               {"new_image_filename.jpg": "--size=50x50 -o new_image_filename.jpg[Q=70]"}, \
               {"croped_image_filename.jpg": "--size=200x150 --crop -o croped_image_filename.jpg[Q=80]"} \
           ]'
Notes
  • /tmp/libvips is used as storage for the downloaded image from S3
  • Argument <JSON_ARRAY>${vipsthumbnail_args}:
    • each json object key HAS to match the filename defined by vipsthumbnail -o param

      ie. {"this_filename_has_to_match.jpg": "--size=50x50 -o this_filename_has_to_match.jpg[Q=70]"}

    • valid json ["param1 param2 etc."] vs invalid json ['param1 param2 etc.']

    • valid json {"param1": "param2"} vs invalid json {param1: "param2"}

  • Avilable support for the following image formats: https://jcupitt.github.io/libvips/ (might require adding new libs and changing compilation config settings)

Tag summary

Content type

Image

Digest

sha256:d6eca5fb4

Size

127.1 MB

Last updated

about 4 years ago

docker pull uqlibrary/vipsthumbnail