Follow-up to #2359443: Allow creating image derivatives from an Image object
Problem/Motivation
From #2359443-17: Allow creating image derivatives from an Image object:
+++ b/core/modules/image/src/Entity/ImageStyle.php
@@ -309,6 +320,23 @@ public function createDerivative($original_uri, $derivative_uri) {
+ // Apply the effects to the image object.
+ foreach ($this->getEffects() as $effect) {
+ $effect->applyEffect($image);
+ }
...
+ return TRUE;
Only now I see this crap. So ImageEffectInterface::applyEffect() does return a success flag but we are not using it here. We just return TRUE regardless if the effects were applied correct. Is there a good reason for this? I don't remember. If there's a reason, we need to document it, otherwise we need something like:
<?php
if (!$effect->applyEffect($image)) {
return FALSE;
}
?>
Proposed resolution
Remaining tasks
- discuss what to do
- write a patch