Drupal - Image styles return Access Denied

It is always recommended to read the release notes of the new release before updating, to make sure that the update doesn't break some of the current features.

The release notes of Drupal 7.20 mentions:

The security fixes in this release change all image derivative URLs generated by Drupal to append a token as a query string. (As an example, links that previously pointed to a URL like http://example.com/sites/default/files/styles/thumbnail/public/field/image/example.png will now point to a URL like http://example.com/sites/default/files/styles/thumbnail/public/field/image/example.png?itok=zD_VaCaD.)

You can add the following line to your settings.php to get the images in the site working:

$conf['image_allow_insecure_derivatives'] = TRUE;

but it would be as good as updating the core and not using the updates ;-)

Some useful links from the page:

  • #1923336: Insert module doesn't work with Drupal 7.20 - contains a working patch to solve this problem.
  • #1923554: New anti-DoS measure breaks for some file URIs.
  • #1923936: Responsive images and styles module doesn't work with Drupal 7.20

UPDATE:

From the release notes of Drupal 7.21, the update includes fixes for incompatibilities introduced in the Drupal 7.20 security release only. So, it is recommended to update to the latest version i.e. 7.21 to use the security fixes in version 7.20.


For what it's worth I also found that somehow my image style directories were no longer set the correct permissions after an upgrade and clear cache.

They root styles/[your style] and styles/[your style]/public should be 755 in order for things to load properly.

Changing them all caused the images to appear properly agaain!

Tags:

Media

7