TYPO3 12.4 - If an image has no crop information, this leads to an error
Closed this issue · 6 comments
[ERROR] Processing task of image file- Exception: PHP Warning: rename(/var/www/html/public/typo3temp/assets/images/bb244917dcb7b55f445298ac5cec10bc.jpg,/var/www/html/public/processed/6/f/csm_8a3ed22a9de3329b6d12c51e7554e6b5d99d1766-fp-1-1-0-0_fd7f8f556f.jpg): No such file or directory in /var/www/html/vendor/typo3/cms-core/Classes/Resource/Driver/LocalDriver.php line 803
Missing fileadmin
in path!
Target must be /var/www/html/public/fileadmin/_processed_/6/f/csm_8a3ed22a9de3329b6d12c51e7554e6b5d99d1766-fp-1-1-0-0_fd7f8f556f.jpg
Problem located in Classes/Xclass/LocalCropScaleMaskHelper.php
focuspoint/Classes/Xclass/LocalCropScaleMaskHelper.php
Lines 84 to 89 in d63aacb
Maybe wrong storage for $targetFIle?
Hey @monosize ,
could you run same debugging in your instance? The "ObjectAccess::setProperty" is very dirty. Perhaps we replace to few properties for the new file?! Could you check "$file->getStorage()". This should be storge "1" with LocalFilesystem driver pointing to fileadmin. You can also check "$file->getPublicUrl()" and check if the URL is right?!
Regards,
Tim
Hey @monosize ,
thanks for the explaintation. But I think this is not the source of the problem. Because if you combine the "absolteBasePath" of the storage with the "identifier" of the file, both are right. Because typo3temp is directly in the public dir and the processed folder is in the fileadmin. And if we "change" the file, we also change the storgage, because the location is changed.
I try to reproduce the problem.... but I need some time and this could take some days/weeks.
Regards,
Tim
Hey @monosize ,
you are right. The line ObjectAccess::setProperty($targetFile, 'storage', $file->getStorage(), true);
is strange I think. We do not reset the storage in the target file, because every file already has its storage and the storage could be different.
If you remove this line, everything works as expected?
Regards,
Tim
The problem only occurred when using the f:image ViewHelper.
When using the focuspoint:image ViewHelper there was no error, then $targetFile has the same storage as $file (typo3temp)
After removing the line it works with f:image
It also works with focuspoint:image Viewhelper