Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Error [TypeError]: Cannot read properties of undefined (reading 'engine') #70

Open
menjithp opened this issue Sep 22, 2023 · 0 comments

Comments

@menjithp
Copy link

menjithp commented Sep 22, 2023

i am using next js and try to compress image at api route( backend) and i am getting this error. error Error [TypeError]: Cannot read properties of undefined (reading 'engine')

my code :

let output_path=path.join(process.cwd(),"public","media","country","less","10mb.jpg")
let input_path=path.join(process.cwd(),"public","media","country","10mb.jpg")
compress_images(input_path, output_path, { compress_force: false, statistic: true, autoupdate: true }, false,
{ jpg: { engine: "mozjpeg", command: ["-quality", "60"] } },
function (error, completed, statistic) {
console.log("-------------");
console.log(error);
console.log(completed);
console.log(statistic);
console.log("-------------");
}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant