mirror of
https://github.com/directus/directus.git
synced 2026-01-26 19:08:09 -05:00
Don't attempt to read metadata for unsupported image types
This commit is contained in:
@@ -44,7 +44,7 @@ export const createFile = async (
|
||||
|
||||
const pipeline = sharp();
|
||||
|
||||
if (payload.type?.startsWith('image')) {
|
||||
if (['image/jpeg', 'image/png', 'image/webp'].includes(payload.type)) {
|
||||
pipeline.metadata().then((meta) => {
|
||||
payload.width = meta.width;
|
||||
payload.height = meta.height;
|
||||
|
||||
Reference in New Issue
Block a user