From 7781f8fa5b252c7f742f3d1007e16a39bc0d059a Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 14 Dec 2017 17:32:58 -0800 Subject: [PATCH] Treat tiffs like unrecognized files; Chrome doesn't render them (#1901) --- js/views/attachment_view.js | 3 ++- js/views/file_input_view.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index e95e62f62..99808366e 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -130,7 +130,8 @@ return this.model.contentType.startsWith('video/'); }, isImage: function() { - return this.model.contentType.startsWith('image/'); + var type = this.model.contentType; + return type.startsWith('image/') && type !== 'image/tiff'; }, mediaType: function() { if (this.isVoiceMessage()) { diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index a383c468a..d89228625 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -70,7 +70,9 @@ }, autoScale: function(file) { - if (file.type.split('/')[0] !== 'image' || file.type === 'image/gif') { + if (file.type.split('/')[0] !== 'image' + || file.type === 'image/gif' + || file.type === 'image/tiff') { // nothing to do return Promise.resolve(file); } @@ -123,6 +125,9 @@ if (!file) { return; } var type = file.type.split('/')[0]; + if (file.type === 'image/tiff') { + type = 'file'; + } switch (type) { case 'audio': this.addThumb('images/audio.svg'); break; case 'video': this.addThumb('images/video.svg'); break;