Slight modification to how we match the mime
This commit is contained in:
parent
ee37731858
commit
730ee4f660
@ -5,7 +5,7 @@ import Dish from "../Dish.mjs";
|
|||||||
import {detectFileType} from "./FileType.mjs";
|
import {detectFileType} from "./FileType.mjs";
|
||||||
import chiSquared from "chi-squared";
|
import chiSquared from "chi-squared";
|
||||||
import potentialOps from "./Test.mjs";
|
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
|
* A class for detecting encodings, file types and byte frequencies and
|
||||||
@ -253,11 +253,8 @@ class Magic {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
async checkMime (data, type) {
|
async checkMime (data, type) {
|
||||||
switch (type) {
|
if (isType(type, data)) {
|
||||||
case "Image":
|
return false;
|
||||||
if (isImage(data))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class RenderImage extends Operation {
|
|||||||
],
|
],
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
type: "Image",
|
type: "image"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user