error: maxMemoryUsageInMB limit exceeded when resizing large jpeg textures
See original GitHub issueDescribe the bug
Resizing large jpeg textures fails with error: maxMemoryUsageInMB limit exceeded
.
To Reproduce
Run gltf-transform resize --width 512 --height 512
on a model with an 8192x8192 jpeg texture.
Additional context This seems to be an upstream bug in the scijs/get-pixels dependency. I opened an issue here: https://github.com/scijs/get-pixels/issues/57.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Nodejs memory gets filled too quick when uploading images
Since I don't have a memory restriction, the app won't crash but the memory usage is ~870MB when uploading a 10MB image. A...
Read more >ImageMagick crashes on large images
ImageMagick is not able to handle larges images. As you can see in the following code, I am running identify on a JPG...
Read more >maxMemoryUsageInMB limit exceeded - Backendless Support
When calling one of my API Services, I'm getting the following error: 668 Error: maxMemoryUsageInMB limit exceeded by at least 24MB.
Read more >Alternative textureResize() implementations · Issue #647 ... - CNHUB
donmccurdy commented 28 days ago ; error: maxMemoryUsageInMB limit exceeded when resizing large jpeg textures #344. Closed ; Resizing textures to 2k is...
Read more >Jimp - npm
var Jimp = require('jimp'); // open a file called "lenna.png" Jimp.read('lenna.png', (err, lenna) => { if (err) throw err; lenna .resize(256 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
/cc https://github.com/donmccurdy/glTF-Transform/issues/647
For folks running into this issue, the manual workaround for glTF files hitting this error would be to unpack the textures (if they aren’t already separate) and resize large textures manually.
The number of textures and size of textures both contribute to memory limits, with ≤4K being generally recommended. Aim for powers of two on each side, like 512px, 1024px, or 2048px. The textures do not need to be square.
Yes this worked for me, thanks for the response on Stack Overflow @donmccurdy, what I did, for anyone else interested, was:
npx gltfjsx ./myfile.gltf --types --shadows --transform --aggressive --draco https://www.gstatic.com/draco/versioned/decoders/1.4.1/
to squish it into a nicely sized glb fileWhen you do 5., the tsx generated might include a
.
in the file name, so either rename them in blender in step 3., or write typescript like so in the generated tsx:https://blender.stackexchange.com/questions/270593/how-to-use-blender-to-get-model-to-a-state-where-it-can-be-shrank-with-gltfjsx?noredirect=1#comment464073_270593