Issue Bug Closed

#105847Generation of fallback files of non-web format fileExtensions uses wrong file extension

Garvin Hicking 12/19/24, 09:03 updated 12/02/25, 14:27

Description

When converting an image to a non-suitable target format, a fallback mechanism is in place which will use a ‘gif_or_jpeg’ method to format the output:

<f:image src="fileadmin/ImageViewHelperTest.jpg" width="200" fileExtension="tif" />

The expected filename result would be “ImageViewHelperTest.jpg” but instead “ImageViewHelperTest.tif” is returned.

The file contents contain the actual JPG target format (not TIF). Depending on how a webserver is configured and file extensions are used for MIME type matching, this would lead to a broken image.

The image extension should instead use the fallback file extension.

Tests which were added with #105846 showcase this behaviour. This bug probably exists in all TYPO3 versions, but set to supported v12 for now.

Reviews 2

History 47

  1. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-12-21T14:23:31+00:00" > 12/21/24, 14:23 </span>

    Please note: This faulty behaviour currently would only be triggerd by the new AVIF implemention, or in very rare edge-cases using the old ‘web’ pseudo-format, only when calling ->convert() manually in code.

  2. Gerrit Code Review pushed patch set 3 for main to change 87567 status Accepted Under Review <span data-processor="relativetime" data-value="2024-12-21T14:24:58+00:00" > 12/21/24, 14:24 </span>

  3. Garvin Hicking commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-01-02T16:40:08+00:00" > 01/02/25, 16:40 </span>

    Applied in changeset commit:2455718e64da30ea616a0e1f6c6e07438a3d6fc0.