Bug #87162

Width and Height in translated meta data records not updated, when original file is replaced

Added by Helmut Hummel 10 months ago. Updated 3 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2018-12-14
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
Tags:
metadata, languages
Complexity:
Is Regression:
Sprint Focus:

Description

Width and height of an image is stored in meta data records.
These properties are extracted by FAL API when a new image is uploaded.
When meta data is localized, DataHandler should take care to update these properties in localized record (see https://forge.typo3.org/issues/81096)

Given a localized meta data record is created exists for a file
When the image is replaced using the file list
I would expect that width and height is updated in all meta data records according to the new image

What actually happens, is that only the meta data record with sys_language_uid = 0 is updated


Related issues

Related to TYPO3 Core - Bug #81096: Images wrongly cropped in translated pages Accepted 2017-05-01

History

#1 Updated by Helmut Hummel 10 months ago

  • Related to Bug #81096: Images wrongly cropped in translated pages added

#2 Updated by Susanne Moog 8 months ago

  • Tags set to metadata, languages

#3 Updated by André Schließer 3 months ago

This behaviour is the same in TYPO3 9.5

If you have a bunch of replaced images and need to fix the data you could use this statement. It searches for differences in width and height fields between translation and parent record and updates the translation fields with the value of the l10n_parent.

UPDATE `sys_file_metadata` AS `dest`,
(
SELECT `translation`.`uid`, `translation`.`l10n_parent`, `translation`.`width`, `translation`.`height`, `parent`.`width` AS `parent_width`, `parent`.`height` AS `parent_height`
FROM `sys_file_metadata` `translation` 
INNER JOIN `sys_file_metadata` `parent` ON `translation`.`l10n_parent` = `parent`.`uid` 
WHERE (`translation`.`width` <> `parent`.`width`) OR (`translation`.`height` <> `parent`.`height`)
) AS `src`
SET `dest`.`width` = `src`.`parent_width`, `dest`.`height` = `src`.`parent_height`
WHERE `dest`.`uid` = `src`.`uid`

Also available in: Atom PDF