Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
When the image is rotated the new image dimensions are not saved (in fact 2 notices are triggered).
This due accessing the wrong paramaters of the $image object:
$new_file->image_dimensions['width'] = $image->width;
$new_file->image_dimensions['height'] = $image->height;
Proposed resolution
Fix the access to the properties:
$new_file->image_dimensions['width'] = $image->info['width'];
$new_file->image_dimensions['height'] = $image->info['height'];
Comment | File | Size | Author |
---|---|---|---|
#2 | image_dimensions_are_not_saved_correct_2563665-2.patch | 590 bytes | zero2one |
Comments
Comment #2
zero2one CreditAttribution: zero2one as a volunteer commentedCreated a patch to fix the wrongly accessed image dimensions.
Comment #3
Johan den Hollander CreditAttribution: Johan den Hollander commentedI confirm that #2 takes this errors away
However I still see 3 more errors when trying to rotate an image in my syslog similar to these described here:
https://www.drupal.org/node/2544678
These errors were present before patching with #2.
Comment #4
Johan den Hollander CreditAttribution: Johan den Hollander commentedRotating works correctly on php 5.3 but on 5.6 it does not work.
This seems to be related: https://www.drupal.org/node/2215369