Sign inSign up

aptive/img

By aptive

•Updated about 18 hours ago

An image resizing and manipulation server

Image
Buildkit cache
0

50K+

aptive/img repository overview

⁠IMG

Docker Hub

An image resizing and manipulation server.

⁠Getting started

docker compose up -d --build

Note: You also may prefer to develop using go directly, however the docker container includes all the necessary dependencies to build and run the application with all functionality. Some functionality may be disabled without dependent packages on your system.

⁠Binding to localhost

In order to access the container ports over localhost you'll need to override the default compose.yml port values and specify your preferred host port. To use the default values, or quickly populate the file, simply:

cp compose.override.example.yml compose.override.yml

Note

Any changes made to the `compose.override.yml` will be ignored by git, to feel free to use this to make any environment-specific changes or overrides without affecting others local settings.

Then (re)start your containers with the new port bindings:

docker compose up -d

⁠Formats

Endpoints currently support the following image formats:

  • image/jpeg with the keyword jpg or jpeg
  • image/png with the keyword png
  • image/gif with the keyword gif
  • image/tiff with the keyword tiff
  • image/bmp with the keyword bmp

With supplemental support for these additional formats:

  • image/heif with the keyword heif or heic. Formatted to image/jpeg by default.

⁠Methods

⁠/display

Display the image, useful when you want to perform operations on the image.

⁠Parameters
  • url - The remote image URL to manipulate
  • quality - The quality to render the image, by default this is the highest.
    • Note: This will only be applied on jpeg format.
  • grayscale - Whether to render the image in grayscale, by default this is false.
⁠/stats

Stats provides information about the image, such as the image's filename, dimensions, size and format.

⁠/qrcode

Generate a QR code with the provided content.

⁠Parameters
  • content - The content to encode in the QR code
  • color - The foreground color (in hex) of the QR Code
  • bgColor - The background color (in hex) of the QR Code (default is transparent)
  • qrWidth - The block width to generate the QR code (max 255)
  • borderWidth - The width of the border (calculated by default)
⁠/upload

NOT IMPLEMENTED

⁠Display Operations

Display operations can be performed on an image by providing various query parameters. Currently, these are only supported on the /display endpoint.

⁠convert
  • format - The format to output the image, by default the format will be the source format, see Formats⁠ for more information.
⁠resize

This will allow you to resize the image to the specified width and height.

If width or height value is not set or 0, the image aspect ratio is preserved.

⁠Parameters
  • width - The desired image's width
  • height - The desired image's height
⁠rotate

This will allow you to rotate the image to the specified degrees.

⁠Parameters
  • degrees - The desired image's rotation in degrees (example: 12.7)
⁠flip

Flips the image vertically (from top to bottom), horizontally (left to right) or both.

⁠Parameters
  • direction - The desired position to flip the image.
    • h, horizontal
    • v, vertical
    • b, both

⁠TODO

  • Add support for image/webp
  • Add support for image/svg+xml
  • Log errors in request with provided zap.Logger
  • Clean up http errors and responses, leverage render package
  • DataDog APM & Metrics
  • Upstream Cfunc_GoBytes memory leak from libheif-dev via libx265

Tag summary

Content type

Image

Digest

sha256:c732ba7ee…

Size

20.5 MB

Last updated

about 18 hours ago

docker pull aptive/img