Skip to content

Fix byte reading/writing to use the correct size in SaveImage()#18

Merged
lastbattle merged 1 commit into
lastbattle:mainfrom
genment:fix/saveimage
Apr 12, 2026
Merged

Fix byte reading/writing to use the correct size in SaveImage()#18
lastbattle merged 1 commit into
lastbattle:mainfrom
genment:fix/saveimage

Conversation

@genment
Copy link
Copy Markdown
Contributor

@genment genment commented Apr 9, 2026

I discovered this bug while exporting .img files from a .wz file, where the exported .img was either corrupted (with fewer bytes than expected) or excessively large (with more bytes than expected).

This issue occurs because the code reads and writes data based on the current position, rather than the actual image size.

While creating this PR, I realized I had been using my own build based on v7 for a long time. I tested v8 and v9, and both work fine. I then found that this bug had been fixed, but I think the fix was not entirely correct, so I just reverted it.

P.S. This bug has existed since the fork’s inception. Original code from hadeutscher

@lastbattle
Copy link
Copy Markdown
Owner

lastbattle commented Apr 12, 2026

Yes it has been fixed in the later version.
Odd how it seems to work somehow (likely vibe coded by claude at that time), with wz .img extracted that are of similar sizes (before and after the PR) 🤔.

@lastbattle lastbattle merged commit 9d5ab27 into lastbattle:main Apr 12, 2026
1 check passed
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 this pull request may close these issues.

2 participants