Issue Bug Closed

#105463Preview images in filelist are always in square format

Felix Heller 10/25/24, 09:26 updated 08/12/25, 14:36

Description

I’ve uploaded an image file in the filelist of TYPO3 13.4.0. The option “Show thumbnails” is enabled. Directly after the upload, the preview image is shown with a correct aspect ratio:

<img src="/typo3/image/process?token=XXXXXXXXXX&amp;id=96667" width="64" height="19" title="typo3-header.jpg" loading="lazy" alt="">

filelist-typo3-header-preview-correct.png

After reloading the filelist, the preview image is shown with a square aspect ratio of 64×64:

<img src="/fileadmin/_processed_/1/9/preview_typo3-header_19635b6aa5.jpg?1729847087" width="64" height="64" title="typo3-header.jpg" loading="lazy" alt="">

filelist-typo3-header-preview-error.png

In the file information dialog, the image is always shown with the correct aspect ratio.

—-

I’m using GraphicsMagick (['GFX']['processor'] = 'GraphicsMagick') in version 1.3.42.

I’ve debugged the code and found out that the creation of the ImageMagick command changed between TYPO3 12.4 and 13.4.

TYPO3 12.4

'/usr/bin/gm' 'convert' -interlace 'None' -auto-orient '+profile' '*' -sample '64'x'64' 'jpg:/var/www/html/releases/current/public/fileadmin/user_upload/typo3-header.jpg[0]'

TYPO3 13.4

'/usr/bin/gm' 'convert' -interlace 'None' -auto-orient '+profile' '*' -auto-orient -sample 64x64! -sharpen 1x2 -quality 85 -colorspace 'RGB' 'jpg:/var/www/html/releases/current/public/fileadmin/user_upload/typo3-header.jpg[0]'

Using 64x64! instead of '64'x'64' for the sample argument forces GraphicsMagick to use exactly this aspect ratio, resulting in the processed square image. While the information dialog uses a configuration of '590m'x'400m' for the processed file, the filelist uses 64x64 and forces integer values. I’ve tried a User TSconfig like this but the values get casted to integer in the core:

options.file_list.thumbnail {
  width = 64m
  height = 64m
}

Reviews 4