Have a site using Drupal 7. The image styles are not being generated.

When I look at the directories where the images should reside, the images do not exist. I checked the permissions in the directories, and they seem okay ("755").

Can anyone help ?

Thanks in advance

Comments

VM’s picture

Any error in the drupal logs?
have you walked up the folder structure to check permissions?
have you tried 777?

have you checked the tmp folder to see if the files are generating there but not being moved to the files folder?

JayD’s picture

VM,

Thanks for your help. Below are the answers to your questions:

There are no errors.
I updated the folder structure to ensure that they are all set to 755.
The tmp folder does not contain any image files.

The article images are being created at sites/default/files/styles/article/public/field/image/
However, the styles at sites/default/files/styles/large/public/field/image/ are not being created

VM’s picture

I'd backup the database
delete the image style and generate a new one a test.

JayD’s picture

I flushed the image style caches, but can't figure out how to remove them completely. Would I need to remove a module to remove the styles? Thanks

Anonymous’s picture

Are you using the Boost module or a CDN? I had a similar issue with my website a while back, and I think it was caused by either Boost or CloudFlare (or maybe it was the combination, I can't remember). Anyway, I did fix it using Imageinfo Cache, which generates the image styles on save instead of on the first request.

JayD’s picture

Not using Boost or CDN. I just installed Imageinfo. Is there a particular setting that you used?

Oddly, the directory where my images should reside has been deleted - sites/default/files/styles/large/public/field/image
Is this normal behavior for the module?

Anonymous’s picture

I just used the default settings.

Have you tried uploading a new image to see if the style gets generated? It should recreate that folder, although I'm not sure why it would delete it in the first place.

JayD’s picture

uploading recreated the directory and image, but is it possible to recreate the style image files without having to re-upload every one ? It would seem like the files should be recreated when the style is edited, but that doesn't seem to happen. Thanks

Anonymous’s picture

The module comes with a Drush command, image-generate, that will generate the images in bulk.

charly71’s picture

Vanilla Drupal 7.50 installation with Media module. I tried both with Media Field turned on and off.
Apache is the owner of new generated folders (one for every format) in the "files/styles" folder (owned by apache and 775).
The content type has a field of type "image" with a view format of resized 450x450 image.
GD is installed and is working correctly.

Bensbury’s picture

I had this same problem. I woke up one morning and an image style already working on other content types just didn't want to happen.
Error reported it couldn't find the file and in the file system the style folder and image weren't created. Checked all permissions and seemed fine. It worked fine for other content types using same field and display.
What worked for whatever reason was to go to the display settings, click the cog and change the display url from Absolute Path (recommended) to Full Url.
Why this make it wake up I have no idea, but maybe it'll help you out or discover what is really going on.

yenidem’s picture

I have same problem, everything was working a few weeks ago and I do not know when it broked up.

GD is working (other Drupal website works on same server without problem)
File permissions are OK.
One of content type works :)
I created another styles but they did not work.
The preview image (drupal logo on image styles) generating.
The server nginx.

I enable multilingual system last month, therefore about this?
I deleted styles directory, and drupal generate also styles directory and creates one of content type images.
I set 777 all directories under files for testing, but nothing changed.
on the error logs shows Permissin denied for images.
I deleted image field and recreated, nothing changed.
I tried a lot of stupid things but did not work :(
I cant believe, one of content type works without problem.

Please advice.

yenidem’s picture

I found the problem, But I have not solved yet.
The problem about multilingual site, when I disable URL (path prefix) in Dedection and Selection, the problem does not appear, but I need that prefixes.

Please advice.
--edit
The problem solved :) As I told above the problem about multilingual site and URL prefix, and my server has Nginx, so I had to change nginx config file for styles directory.
The solutions is below.
https://www.drupal.org/node/2150483#comment-11686279

location ~ ^/sites/.*/files/styles/ {
    try_files $uri @rewrite;
}
to location ~ .*/sites/.*/files/styles/ {
Kojo Unsui’s picture

@yenidem, I lost a couple of hours wondering why my usual permisssions setup were not working... Indeed replacing

location ~ ^/sites/.*/files/styles/ {
    try_files $uri @rewrite;
}

by

location ~ .*/sites/.*/files/styles/ {
try_files $uri @rewrite;
}

did the trick ! You saved my night ! Thank you.

hellobank’s picture

It works on my sites.    thanks.

Alexej Schmidt’s picture

It works fine. Tnx!

kanaan.ngutu’s picture

If the file permission is ok then you only need to remove the image style and then re-add it and see if it works. It works well for me.

zakir.gori’s picture

I have done everything like removing .htaccess folder permission even i have install new module image style pregenrator but nothing is working for me i am using drupal 7 please suggest something.

zakir.gori