Part 4 - Automatically resize and crop images

Yellow Lite allows you to resize and crop all images before sending them to any of the destinations.

  1. Copy the original file to the archive folder (if active)
  2. Resize and crop the image (if configured)
  3. Upload the image to the configured destinations (if configured)

All configurations have to be added to the central config file.

sudo leafpad ~/Desktop/application.properties

Please remember to restart the `yellow` service to apply any
configuration change.

sudo service yellow restart

Resize image

To keep the image archive in a manageable size, it makes sense to resize all images before uploading. You can enable resizing by adding one of the two lines to your application.properties file.

image.resize.width=1000
image.resize.height=1000

If you configure only the width or height of the image, Yellow Lite will calculate the corresponding other value to retain the aspect ratio. You can also configure the height as well as the width. But in such a case the resulting image may be stretched or squashed.

Crop image

Once the the image is resized, you can also crop it. The parameters are the following:

image.crop.x=0
image.crop.y=0
image.crop.height=1080
image.crop.width=1920

The `height` and `width` are the size of the new image, `x` and `y` define the coordinates of the top left corner of the new image in the original image. In the above example, Yellow Lite would create a new image with 1920×1080 pixels starting at the top left corner of the original image.

JPEG quality

As soon as you resize or crop the image, the JPEG will be compressed with a quality of 90%. You can increase or decrease this value to produce better image quality or smaller files.

image.jpg.quality=90

If you do not resize or crop the image, the original image will be uploaded without modifications.