I tested your solution but found an issue - though not related to your changes, it means the usage of sha1 makes the solution brittle (if hash is not yet created, a an exception is shown with "hash must be a string"). There is however a different solution:
I verified this by forcing the processed image to "use the original" in \TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor::processTask by forcing the logic to enter the first condition and trigger:
if ($result === null) {
$task->setExecuted(true);
$task->getTargetFile()->setUsesOriginalFile();
$result would be null if the image scaling logic internally failed to resize the image for any reason (image subsystem not configured, image format not scalable, etc.)
Checking if $processedImage->usesOriginalFile() should solve the problem we have and seems to be a pretty solid solution. I don't think we would need to start looking at the size etc. of the original file to only set $inline = false in case it's actually a big image - it is probably best (and simplest and more predictable) just to always disable $inline in case the image couldn't be processed.
Thanks for getting this started, @Atomschinken!
I tested your solution but found an issue - though not related to your changes, it means the usage of sha1 makes the solution brittle (if hash is not yet created, a an exception is shown with "hash must be a string"). There is however a different solution:
I verified this by forcing the processed image to "use the original" in
\TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor::processTask
by forcing the logic to enter the first condition and trigger:$result
would be null if the image scaling logic internally failed to resize the image for any reason (image subsystem not configured, image format not scalable, etc.)Checking if
$processedImage->usesOriginalFile()
should solve the problem we have and seems to be a pretty solid solution. I don't think we would need to start looking at the size etc. of the original file to only set$inline = false
in case it's actually a big image - it is probably best (and simplest and more predictable) just to always disable$inline
in case the image couldn't be processed.