From 7079be0747c63621a0d7d17f48a6d5b3ce02c6c9 Mon Sep 17 00:00:00 2001 From: Pierre Buyle Date: Mon, 31 Oct 2011 16:54:15 +0100 Subject: [PATCH] Issue #1327398: Image file formatter return link to a broken image for unsupported image formats. --- file_entity.module | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/file_entity.module b/file_entity.module index cd35d9a..7a0b8c1 100644 --- a/file_entity.module +++ b/file_entity.module @@ -423,7 +423,7 @@ function file_entity_file_formatter_file_field_settings($form, &$form_state, $se function file_entity_file_formatter_file_image_view($file, $display, $langcode) { $scheme = file_uri_scheme($file->uri); $local_wrappers = file_get_stream_wrappers(STREAM_WRAPPERS_LOCAL); - if (isset($local_wrappers[$scheme]) && strpos($file->filemime, 'image/') === 0) { + if (isset($local_wrappers[$scheme]) && strpos($file->filemime, 'image/') === 0 && image_load($file->uri)) { if (!empty($display['settings']['image_style'])) { $element = array( '#theme' => 'image_style', -- 1.7.1