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.

Files: 
CommentFileSizeAuthor
#1 file_entity_image_formatter_returns_null_for_unsupported_format-1327398-1.patch1.08 KBmongolito404
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch file_entity_image_formatter_returns_null_for_unsupported_format-1327398-1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.08 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch file_entity_image_formatter_returns_null_for_unsupported_format-1327398-1.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

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.