User Tools

Site Tools


Translations of this page:



rotation_crop_profiles

Rotator Crop Profiles

Allows you to set special settings for processing thumbs for galleries of each sponsor.

For example, sponsor A has a logo at the bottom of all images that needs to be cropped, and the thumbs are too dark. Sponsor B doesn't have a logo, but the thumbs are too light.

By creating 2 different profiles for processing galleries of these sponsors, you can automate the creation of high-quality thumbs. When importing galleries, specify which profile to use for creating thumbs.

Hybrid thumb size

You can create thumbs of different sizes depending on the size of the source. That is, have 2 sizes: for vertical and horizontal sources.

For example, we have a size of 100 x 200 (vertical) in the crop profile, and a horizontal source appears in the gallery. If Hybrid thumb size is specified - then this size will be used (for example 200×100) to create a thumb from horizontal content.

Skip thumb if image ratio

Ability to skip images if they deviate from the general.

For example, importing a gallery, there are 10 images, we need to make a thumb 150×200, but the source is for example 150 by 500, that is clearly it will crop somewhere in the center and probably the thumb will turn out ugly. You can skip it.

Skip thumb if image ratio deviates more then X percent from target thumb size

that is if the aspect ratio is more by X percent, then we skip. For example, set to 10, 150/200 = 0.75

This means if the aspect ratio in the source is more than 0.75+10% = 0.825 or less than 0.675 then we skip.

Additional IM commands

Crop profiles support additional ImageMagick (IM) commands—custom strings that apply to original images or finished thumbs. While available for some time, they're now more useful.

When editing a crop profile, find two fields: Image IM and Thumb IM. These let you add custom IM commands for original images and thumbnails respectively. For example, external utilities can compress JPEGs to 7% or make them interlaced for faster visual loading.

Consider the example http://freecode.com/projects/jpegoptim - jpegoptim is a utility for optimizing JPEG files. It provides lossless optimization (based on optimizing the Huffman tables) and “lossy” optimization based on setting a maximum quality factor.

  • Ask the admin to install jpegoptim
  • In the crop profile add Thumb IM - /usr/local/bin/jpegoptim –strip-all {FILE} {FILE}

Here you need to note that the path to jpegoptim on different servers may differ - it makes sense to ask the admin. {FILE} is replaced with the actual filename. In this example it appears 2 times because jpegoptim requires input and output filename, and in our example it's the same file.

Video Preview

When importing video, the Video Preview option creates preview clips. The script extracts X pieces (Amount of cuts), each Y seconds long (Cut duration), resizes them to thumbnail dimensions, and combines them into a preview video for the gallery.

Specify FFmpeg parameters in this field. The default is:

``` -vf scale={x_size}:{y_size} -map 0 -map -0:a -preset slow -crf 18 ```

The `{x_size}:{y_size}` values come from your crop profile. You can change them if you want a different preview size—for example, thumbnails at 320×200 but preview videos at 200×150.

The default preserves the original video's aspect ratio. If you want to crop to your exact format instead:

``` -vf “crop=w='min(min(iw\,ih)\,{x_size})':h='min(min(iw\,ih)\,{y_size})',scale={x_size}:{y_size},setsar=1” -map 0 -map -0:a -preset slow -crf 18 ```

Example from a user:

``` -preset veryslow -c:v libx264 -r 24 -vf “crop=min(iw\,trunc(ih*({x_size}/{y_size}))):trunc(ow/({x_size}/{y_size})):trunc(iw/2-ow/2):trunc(ih/2-oh/2),crop=ceil((iw*0.8)/2)*2:ceil((ih*0.8)/2)*2:ceil(iw*0.1):ceil(ih*0.1),scale=ceil(({x_size}*0.9)/2)*2:ceil(({y_size}*0.9)/2)*2” -an -reset_timestamps 1 -crf 24 -maxrate 210k -bufsize 420k ```

This approach: - First crop captures the maximum visible area with needed proportions - Second crop removes 10% from edges (where logos or black bars appear) - Resizes the video to 90% of the thumbnail size

You can adjust these percentages as needed.

rotation_crop_profiles.txt · Last modified: 2026/03/21 10:11 by 127.0.0.1