Problem

When displaying a file entity with the Image (file_image) formatter, file_entity_file_formatter_file_image_view always return an element if the file's scheme is local and if its mime type starts with image/. When an image style is used, the returned element produces a <img> tag to the file derivative. But this derivative only works if the file format is supported by the current image toolkit. When no file style is used, a <img> tag to the original file is produced.

Because of this, it is not possible to use another formatter to display non supported image formats like tiff or bmp.

Proposed resolution

In file_entity_file_formatter_file_image_view, check that the image is loadable using the current image toolkit before returning an element. Otherwise, don't return anything.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pbuyle’s picture

Dave Reid’s picture

Status: Needs review » Fixed

Makes sense and tested. Committed to both File entity 7.x-2.x and Media 7.x-1.x.
http://drupalcode.org/project/file_entity.git/commit/ba1b95a
http://drupalcode.org/project/media.git/commit/b2426fb

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.