#110318ProcessedFile::getForLocalProcessing() asks the processing storage for a file that points to the original
Description
Problem
When processing produces no new file (for example if the original is already smaller than the requested size) the processed file is only a pointer to the original: usesOriginalFile() is true and getIdentifier() returns the identifier of the original file, while getStorage() returns the processing storage.
Every accessor compensates for that mismatch (exists(), getName(), getMimeType(), getSize(), getPublicUrl(), toArray()).
@getForLocalProcessing()@ does not, because ProcessedFile never overrides it:
// AbstractFile::getForLocalProcessing()
return $this->getStorage()->getFileForLocalProcessing($this, $writable);
The identifier of the original file is therefore handed to the driver of the processing storage.
This is not a problem when:
- both are the same storage
- a local driver is used (this just returns a path to a non-existing file, also not great but not breaking)
But when you have the processingfolder of one storage pointing to another one (2:_processed_/) and using a remote driver (in my case S3) this means that the image does not exist and it throws an error and the image rendering fails.
Steps to reproduce
- Add a second
Localstorage, base pathfileadmin/processed_storage/. - Set Processing folder of storage 1 to
2:/. - Upload a (for example) 200×200 image and render it without scaling, for example
<f:image image="{file}" maxWidth="1000" />.
$processed = $file->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, ['maxWidth' => 1000]);
$processed->usesOriginalFile(); // true
$processed->getPublicUrl(); // fileadmin/user_upload/image.jpg <- correct
$processed->getForLocalProcessing(); // .../fileadmin/processed_storage/... <- wrong storage
Expected: getForLocalProcessing() returns a local copy of the original file, consistent with getPublicUrl().
Regression
ProcessedFile never had an override of the method but it became a problem with the change in #106518, where ImageResource::createFromProcessedFile() was switched from getPublicUrl() to getForLocalProcessing()
Affected: 13.4.10 and newer
Related
- #106518 – introduced the call
- #89004 – describes how the empty-identifier state arises
- #106985 – same call chain
Reviews 1
Related issues 3
History 35
-
Riny van Tiggelen changed description <span data-processor="relativetime" data-value="2026-07-29T11:09:36+00:00" > 07/29/26, 11:09 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 94982 status
NewUnder Review <span data-processor="relativetime" data-value="2026-07-29T11:18:31+00:00" > 07/29/26, 11:18 </span> -
Garvin Hicking changed Related to #106518 Related to #89004 <span data-processor="relativetime" data-value="2026-07-29T13:38:12+00:00" > 07/29/26, 13:38 </span>
-
Garvin Hicking changed Related to #106985 <span data-processor="relativetime" data-value="2026-07-29T13:38:18+00:00" > 07/29/26, 13:38 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 94982 <span data-processor="relativetime" data-value="2026-10-01T07:47:33+00:00" > 10/01/26, 07:47 </span>