protected function applyAdjustments(ImageInterface $image, array $adjustments, &$adjustmentsApplied)
{
foreach ($adjustments as $adjustment) {
if (!$adjustment instanceof ImageAdjustmentInterface) {
throw new ImageServiceException(sprintf('Could not apply the %s adjustment to image because it does not implement the ImageAdjustmentInterface.', get_class($adjustment)), 1381400362);
}
if ($adjustment->canBeApplied($image)) {
$image = $adjustment->applyToImage($image);
$adjustmentsApplied = true;
}
}
return $image;
}