Skip to content

Commit

Permalink
Treat tiffs like unrecognized files; Chrome doesn't render them (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg authored Dec 15, 2017
1 parent 5caee59 commit 7781f8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/views/attachment_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
7 changes: 6 additions & 1 deletion js/views/file_input_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7781f8f

Please sign in to comment.