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

Add an opt in option to use imagemin instead of wasm libs #10

Open
andreisergiu98 opened this issue Aug 25, 2020 · 4 comments
Open

Add an opt in option to use imagemin instead of wasm libs #10

andreisergiu98 opened this issue Aug 25, 2020 · 4 comments

Comments

@andreisergiu98
Copy link

Trying to fix cyrilwanner/next-optimized-images#195 i ended up patching the loader to use image-min so i can build the images, so i was thinking maybe we could add an opt in option to use system libs instead of wasm, it should be a little bit faster and it can use as much memory as the system has. I am willing to make a PR, but i wanted to check in with you first to discuss about the configuration structure. When i have time i'll make a proposal :).

@tilman
Copy link

tilman commented Sep 9, 2020

Since you are talking about memory problems I guess you had the same RangeError: WebAssembly.Memory(): could not allocate memory?
Would be really happy to see your proposal :)

@semyou
Copy link

semyou commented Sep 14, 2020

@andreisergiu98 Do you mind sharing your solution? I am stuck. My prod used to work with the previous version (though slow). When I migrated to canary v10, my 2G RAM VPS is not able to build site that has only 4 images! Now I am stuck and I don't want to roll back. BTW, works perfectly fine on my laptop with plenty of RAM.

@andreisergiu98
Copy link
Author

@semyou I cloned this repository and replaced wasm-codecs from src/optimize/jpeg.ts and src/optimize/png.ts with imagemin (with mozjpeg and pngquant plugins), then i added it into the project as a yarn workspace. I think yarn resolution would also work.

@Nadav42
Copy link

Nadav42 commented Oct 6, 2020

Also need a solution for RangeError: WebAssembly.Memory(): could not allocate memory, subscribing.

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

Successfully merging a pull request may close this issue.

4 participants