#96529Filereference: no "width" and "height" properties if image from Initialisation Folder
Description
If you copy images via your extension into the fileadmin via /typo3conf/ext/my_ext/Initialisation/Files, the meta data “width” and “height” are empty. See screenshot attached.
If I then manually upload the image again via Filelist, then “width” and “height” are correct.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 2
History 7
-
Oliver Hader commented and changed status
NewNeeds Feedback 01/14/22, 12:14 -
Lukas Hausammann commented 01/14/22, 12:28
Its my own sitepackage extension which is structured as a distribution as described here:
[[https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/CreateNewDistribution/Index.html#fileadmin-files]] -
David Bruchmann commented 03/06/23, 15:58
I just had the same issue with TYPO3 version 11.5.24.
I changed \TYPO3\CMS\Core\Resource\FileReference for it, this is my version of the according method:public function getProperty($key) { $properties = $this->getProperties(); if (!$this->hasProperty($key)) { if ( in_array($key, ['width', 'height']) && $this->originalFile->isImage() && $this->originalFile->getStorage()->getDriverType() === 'Local' ) { $rawFileLocation = $this->originalFile->getForLocalProcessing(false); $imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $rawFileLocation); $missingInfo = $imageInfo->{'get' . ucFirst($key)}(); if ($missingInfo) { return $missingInfo; } else { throw new \InvalidArgumentException('Value for property "' . $key . '" could not be determined.', 1678113486); } } else { throw new \InvalidArgumentException('Property "' . $key . '" was not found in file reference or original file.', 1314226805); } } return $properties[$key]; }Actually the call is coming from the …\DataProcessing\GalleryProcessor, so it might perhaps better to fix it there, but I never looked deeper in it.
-
David Bruchmann changed attached FileReference-getProperty.diff 03/07/23, 09:18
-
Jonas Götze commented 05/12/23, 11:19
Had the same issue with TYPO3 11.5.27 after importing files with ext:migration. Running the scheduler FileStorageIndexingTask solved the issue, as it created the missing metadata-records.
-
Stefan Bürk commented 06/30/24, 21:59
The code importing the file to the fileadmin must use proper FileAbstractionLayer API
and also enforce metadata retrieval/update on it, like it is done on a file upload. If
that is missing, the scheduler task will fix it (if it is executed in that system). -
Georg Ringer commented and changed status
Needs FeedbackRejected 07/11/24, 10:35closing the issue as proper API or tasks to update metadata must be used
Can you please mention which extension has been imported and which version?
To which imported file/path does the screenshot relate?
Thanks in advance for your feedback, this makes it easier to actually reproduce the behavior locally.