Problem/Motivation
The conditional statement in question is:
if ($item->target_id == $file->id() && $item->width != $width || $item->height != $new_height)
in the ImageResize.php from the QueueWorker
This condition mistakenly evaluates to true when $item->target_id is not equal to $file->id(), yet $item->height does not match new_height.
The expected behavior is for all checks to be associated with the condition where $item->target_id == $file->id().
Proposed resolution
To address this issue, the logical grouping in the conditional expression needs adjustment. The corrected version of the code should use parentheses to ensure the right order of evaluation:
if ($item->target_id == $file->id() && ($item->width != $width || $item->height != $new_height))
This adjustment will ensure that the width and height checks are only considered when the target ID actually matches.
Remaining tasks
Provide a MR
User interface changes
none
API changes
none
Data model changes
none
Issue fork image_resize-3441498
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
isaacrc commentedComment #5
berdirThanks, merging.