mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-09 03:51:42 +00:00
with_pixel_size read only the PNG's header, so a PNG with a whole IHDR and a cut-off body passed as the one to paste. Since #1724 image.place refuses it as damaged, and nothing was pasted: the decoded clipboard image, which paste falls back to for an unreadable PNG, was never tried. The PNG is now decoded in full before it is accepted, so the paste falls back as it does for any other unreadable PNG. The zero-size and pixel-count checks run ahead of that decode, so an image past the limit is refused before it is decoded. Raised by CodeRabbit on #1360 after the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>