Use `MIME` module
This commit is contained in:
parent
ba2cf7770e
commit
3eaace6f3a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue