Skip to content

Commit 81a8838

Browse files
fix(endpoint-media): only perform image transformations on images
1 parent bf16e8d commit 81a8838

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/endpoint-media/lib/media-transform.js

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import sharp from "sharp";
77
* @returns {Promise<object>} Media file
88
*/
99
export const mediaTransform = async (imageProcessing, file) => {
10+
// Function currently only supports transforming images
11+
if (!file.mimetype.includes("image/")) {
12+
return file;
13+
}
14+
1015
const { resize } = imageProcessing;
1116

1217
file.data = await sharp(file.data).rotate().resize(resize).toBuffer();

0 commit comments

Comments
 (0)