From 3eaace6f3a21421c5aaaaf01592408c7ed83ecd3 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Tue, 13 Feb 2018 08:35:05 -0500 Subject: [PATCH] Use `MIME` module --- js/modules/types/attachment.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/modules/types/attachment.js b/js/modules/types/attachment.js index 9a5811913..9e233c1cc 100644 --- a/js/modules/types/attachment.js +++ b/js/modules/types/attachment.js @@ -1,5 +1,6 @@ const dataURLToBlob = require('blueimp-canvas-to-blob'); +const MIME = require('./mime'); // // Fields // { @@ -14,9 +15,6 @@ const dataURLToBlob = require('blueimp-canvas-to-blob'); // data: ArrayBuffer // } -const isJPEG = mimeType => - mimeType === 'image/jpeg' || mimeType === 'image/jpg'; - // Data type conversion const blobToArrayBuffer = blob => new Promise((resolve, reject) => { @@ -45,7 +43,7 @@ const withLastNormalizedDate = attachment => Object.assign( ); const autoOrientJPEGs = async (attachment) => { - if (!isJPEG(attachment.contentType)) { + if (!MIME.isJPEG(attachment.contentType)) { return attachment; }