Slight modification to how we match the mime

This commit is contained in:
n1073645 2019-12-06 12:39:32 +00:00
parent ee37731858
commit 730ee4f660
2 changed files with 4 additions and 7 deletions

View file

@ -5,7 +5,7 @@ import Dish from "../Dish.mjs";
import {detectFileType} from "./FileType.mjs";
import chiSquared from "chi-squared";
import potentialOps from "./Test.mjs";
import { isImage } from "./FileType.mjs";
import { isType } from "./FileType.mjs";
/**
* A class for detecting encodings, file types and byte frequencies and
@ -253,11 +253,8 @@ class Magic {
* @returns {boolean}
*/
async checkMime (data, type) {
switch (type) {
case "Image":
if (isImage(data))
if (isType(type, data)) {
return false;
break;
}
return true;
}

View file

@ -47,7 +47,7 @@ class RenderImage extends Operation {
],
null,
{
type: "Image",
type: "image"
}
);
}