Bug When Rendering Non-JPEG Image Thumbnails
Created originally on Bitbucket by lambjs (Josh Lamb)
As we've seen in the orange implementation, image files of extensions other than JPEG are not rendering thumbnails and are instead breaking during execution. File extensions which filemanager considers images are defined in $ext_presets['img'] in Filemanager.php on line 206 (currently supported are jpg, jpeg, bmp, png, gif). These are used to tell filemanager how to deal with these files for thumbnail render as well as for file type filtering. See also in function dynamic_thumbnail() that all image types are assumed to be supported for resampling to a smaller thumb size, but only JPEG is actually implemented. Right now when it tries to blindly process a different extension, it runs it through the JPEG code which generates PHP warnings and then serves the default extension image anyway. When error reporting is enabled it causes three php warnings to output before the thumbnail's binary content which breaks the rendering in filemanager for this file.