Skip to content

Commit 6e4d54b

Browse files
committed
MimeTypes
1 parent b4f104d commit 6e4d54b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

classes/Project/ProjectFactory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Layer from "../Layer/Layer.js"
55
import dbDriver from "../../database/driver.js"
66
import vault from "../../utilities/vault.js"
77
import imageSize from 'image-size';
8+
import mime from 'mime-types';
89

910
const database = new dbDriver("mongo")
1011

@@ -238,7 +239,7 @@ export default class ProjectFactory {
238239
body: {
239240
id: imageURL,
240241
type: "Image",
241-
format: `image/${imageURL.split('.').pop()}`,
242+
format: mime.lookup(imageURL) || "image/jpeg",
242243
width: dimensions.width,
243244
height: dimensions.height
244245
},

0 commit comments

Comments
 (0)