mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-07-27 00:39:26 +00:00
createAttachmentStream() never populated SignalServiceAttachmentStream's width/height fields, even though the Builder has supported them since at least the currently pinned libsignal-service version. Without them, other Signal clients render outgoing image attachments as a square-cropped thumbnail instead of their actual aspect ratio. Probe dimensions via ImageIO for image/* attachments up to 20MiB (buffered in memory only for that check) and pass them through to the builder. Falls back to width/height 0 (today's behavior) for non-images, oversized files, or anything ImageIO can't parse.