Skip to content

feat(send): embed JPEG thumbnail in image messages#88

Open
Samuel-Nun3s wants to merge 1 commit into
evolution-foundation:mainfrom
Samuel-Nun3s:feat/image-jpeg-thumbnail
Open

feat(send): embed JPEG thumbnail in image messages#88
Samuel-Nun3s wants to merge 1 commit into
evolution-foundation:mainfrom
Samuel-Nun3s:feat/image-jpeg-thumbnail

Conversation

@Samuel-Nun3s

Copy link
Copy Markdown

WhatsApp renders the gray/green camera placeholder for ImageMessages sent without a JPEGThumbnail, only showing the picture after a manual download. This affects /send/media for both regular chats and newsletters (channels).

Generate a small (~72px) JPEG preview from the source bytes and set it on ImageMessage.JPEGThumbnail across all media image paths (sendMediaFileWithRetry, sendMediaUrlWithRetry, sendStatusMedia) so the usual blurred inline preview is shown. Generation failures degrade gracefully: the message is still sent, just without the inline preview.

Description

Related Issue

Closes #(issue_number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement

Testing

  • Manual testing completed
  • Functionality verified in development environment
  • No breaking changes introduced

Screenshots (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have tested my changes thoroughly
  • Any dependent changes have been merged and published

Additional Notes

WhatsApp renders the gray/green camera placeholder for ImageMessages
sent without a JPEGThumbnail, only showing the picture after a manual
download. This affects /send/media for both regular chats and
newsletters (channels).

Generate a small (~72px) JPEG preview from the source bytes and set it
on ImageMessage.JPEGThumbnail across all media image paths
(sendMediaFileWithRetry, sendMediaUrlWithRetry, sendStatusMedia) so the
usual blurred inline preview is shown. Generation failures degrade
gracefully: the message is still sent, just without the inline preview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Samuel-Nun3s, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

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.

1 participant