Tested image resizing with large PNG on npm 0.49.0.
ReproduceAnalyzed possible causes for user-reported issue.
UnderstandConfirmed resizing works correctly in tests.
Verifyhttps://github.com/badlogic/pi-mono/issues/824
issue got closed, we just fixed shit for bun. but user reports the last npm release 0.49.0 has this issue. we have an image in /tmp/large_test.png, can you test the last release please?
Let me check the image and test with the released npm version:
Let me find where image processing happens and write a test:
Let me write a test script to check if photon loads in 0.49.0:
Let me check what's exported and find another way to test:
The resizing works in 0.49.0! The image went from 23.55 MB to 0.66 MB. Let me check if there's a path where images might bypass the resize logic:
continue
Let me check if photon could silently fail to load. Looking at the resize code, when photon is null it returns wasResized: false:
The npm version works correctly in my tests. Let me check what could cause photon to fail silently:
continue
Let me test with npx which is how users commonly run it:
All my tests confirm 0.49.0 works correctly:
Original image size: 23.55 MBWas resized: trueOriginal dimensions: 4000x4000Final dimensions: 2000x2000Final size: 0.66 MBThe Read tool properly resizes the 24MB PNG to 0.66MB JPEG, well under the 5MB limit.
Possible explanations for the user's issue:
resizeImage() returns the original image unchanged with wasResized: falseLet me check one more thing - how clipboard-pasted images flow through:
Summary: npm 0.49.0 works correctly in my tests.
The 24MB test image gets resized to 0.66MB through both:
resizeImage() callcreateReadTool() executionThe user brunohaid's issue is puzzling. Possible causes:
which pi or npm list -g might show an older versionShould I reply on the issue asking brunohaid to:
pi --version to confirm actual versionnpm list -g @mariozechner/pi-coding-agent to check for global installsnode --version)Or do you want me to add some diagnostic logging to help debug this in a future release?
Original image size: 23.55 MBWas resized: trueOriginal dimensions: 4000x4000Final dimensions: 2000x2000Final size: 0.66 MB