danielholmes / jimp-vite

Try and get JIMP working with Vite (note, website shows console error, not working)
https://danielholmes.github.io/jimp-vite/
1 stars 0 forks source link

Doesn't work with PNG #1

Open gevhambarzumyan93 opened 8 months ago

gevhambarzumyan93 commented 8 months ago
@jimp_png.js?v=3800d7c6:7641 Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
    at node_modules/browserify-zlib/lib/index.js (@jimp_png.js?v=3800d7c6:7641:100)
    at __require2 (chunk-R3NO7AUE.js?v=cd1c5015:26:50)
    at node_modules/@jimp/png/node_modules/pngjs/lib/parser-async.js (@jimp_png.js?v=3800d7c6:9208:16)
    at __require2 (chunk-R3NO7AUE.js?v=cd1c5015:26:50)
    at node_modules/@jimp/png/node_modules/pngjs/lib/png.js (@jimp_png.js?v=3800d7c6:10160:18)
    at __require2 (chunk-R3NO7AUE.js?v=cd1c5015:26:50)
    at @jimp_png.js?v=3800d7c6:10295:28

maybe you have some solution?

danielholmes commented 8 months ago

@gevhambarzumyan93 Did you see the section in the README that mentions I only got it working with JPEG for now?

To get it working with png you'll need to make your own JIMP root package. See: https://github.com/danielholmes/jimp-vite/blob/main/src/custom-jimp.ts . And for how jimp does it, see:

https://github.com/jimp-dev/jimp/blob/main/packages/jimp/src/index.js https://github.com/jimp-dev/jimp/blob/main/packages/plugins/src/index.js

If you're done that can you please share a repo with me to show what you've done?

I think I did try getting png working at one point, but PNG.js had too many node/commonjs dependencies and I eventually stopped trying to get them all working.