Warning: Division by zero in theme_image_style_preview() (line 804 of /var/www/html/modules/image/image.admin.inc).
Warning: array_intersect_key(): Argument #1 is not an array in theme_image_style_preview() (line 806 of /var/www/html/modules/image/image.admin.inc).

I am receiving the above errors when I view several of the "stock" image styles on my site. I just moved my site from a development server to a production server, and the error does not occur on the development server version. I checked the directory permissions on the production server, and they appear to be consistent with the development server's permissions.

One really strange thing occurs when I view the source on the "preview image" in the admin back-end of one of those styles that has the issue. When I do, it shows the following path being called (which is, of course, not a valid path):

http://mysite.com/sites/default/files/styles/large/public/modules/image/sample.png?cache_bypass=1399676683

The bold part seems to be part of the issue, but I am not sure how that got there. All of my custom image styles work fine.

Thanks!

Comments

asiviero’s picture

I got the same issue upon deploying because my server didn't have the php-gd package available, try installing it

Georg2791’s picture

Hello hockey2112,
I am getting the same errors on a new drupal install - PHP 5.5.9-1ubuntu4.7
The PHP-GD is installed.What would be the cause? Permissions SET what would be for these files?
Thanks
George

sgp913’s picture

I just had the same issue with a fresh install.

chmod 775 sites/default/styles