Skip to content

Allow image/jpg mimetype as image/jpg and image/jpeg are the same #158

@adarshsingh87

Description

@adarshsingh87

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @imgly/background-removal-node@1.4.5 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@imgly/background-removal-node/dist/index.cjs b/node_modules/@imgly/background-removal-node/dist/index.cjs
index d507f4c..81dee6f 100644
--- a/node_modules/@imgly/background-removal-node/dist/index.cjs
+++ b/node_modules/@imgly/background-removal-node/dist/index.cjs
@@ -67,6 +67,7 @@ async function imageDecode(blob) {
     case "application/octet-stream":
     case `image/png`:
     case `image/jpeg`:
+    case `image/jpg`:
     case `image/webp`: {
       const decoded = (0, import_sharp.default)(buffer);
       let { width, height, channels } = await decoded.metadata();
diff --git a/node_modules/@imgly/background-removal-node/dist/index.mjs b/node_modules/@imgly/background-removal-node/dist/index.mjs
index 687f5ac..f830541 100644
--- a/node_modules/@imgly/background-removal-node/dist/index.mjs
+++ b/node_modules/@imgly/background-removal-node/dist/index.mjs
@@ -30,6 +30,7 @@ async function imageDecode(blob) {
     case "application/octet-stream":
     case `image/png`:
     case `image/jpeg`:
+    case `image/jpg`:
     case `image/webp`: {
       const decoded = sharp(buffer);
       let { width, height, channels } = await decoded.metadata();

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions