fix: share higher resolution images to Bluesky#1085
Open
vytisbulkevicius wants to merge 2 commits into
Open
Conversation
Bluesky rejects image blobs over 1,000,000 bytes, so the shared image always used the WordPress "large" size and often looked blurry. Pick the largest available size (full, 2048, 1536, large) whose file is within the limit, and fall back to the original URL on any failure so behaviour is never worse. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Soare-Robert-Daniel
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Images shared to Bluesky were low-resolution/blurry because the pipeline always used the WordPress
largesize (~1024px). That size was used because Bluesky'suploadBlobendpoint rejects images larger than 1,000,000 bytes.This picks the largest available image size that still fits the limit — trying
full→2048x2048→1536x1536→large— so the sharpest acceptable image is uploaded. For external images, an unresolved attachment, or when nothing larger fits, the original URL is returned unchanged, so it is never worse than before. The limit and size priority are filterable (rop_bluesky_max_image_bytes,rop_bluesky_image_size_priority).Will affect the visual aspect of the product
NO
Test instructions
largesize (e.g. ~2048px tall) and the post still publishes.Check before Pull Request is ready:
Closes https://github.com/Codeinwp/tweet-old-post-pro/issues/651