Skip to content

Enhance ActivityPub image attachments with width/height metadata#17563

Draft
Copilot wants to merge 3 commits into
developfrom
copilot/feature-include-width-height-properties
Draft

Enhance ActivityPub image attachments with width/height metadata#17563
Copilot wants to merge 3 commits into
developfrom
copilot/feature-include-width-height-properties

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

  • ActivityPub attachment payload
    • ApRendererService.renderDocument() now includes image dimensions from DriveFile.properties:
      • width
      • height
  • Type surface update
    • Extended ActivityPub object typing (IObject) with optional width?: number / height?: number.
  • Coverage
    • Added a focused unit assertion in packages/backend/test/unit/activitypub.ts to verify rendered document dimensions.
  • Changelog
    • Added an Unreleased Server entry for this enhancement.
return {
	type: 'Document',
	mediaType: file.webpublicType ?? file.type,
	url: this.driveFileEntityService.getPublicUrl(file),
	name: file.comment,
	width: file.properties?.width,
	height: file.properties?.height,
	sensitive: file.isSensitive,
};

Why

Misskey’s ActivityPub image attachments previously omitted size metadata, which forces federated clients to assume square aspect ratios until media is fetched.
Including width/height aligns Misskey output with common AP implementations and enables better initial remote layout.

Additional info (optional)

  • Scope
    • Server-side ActivityPub serialization only; no DB schema or migration changes.
  • Compatibility
    • Fields are optional and emitted only when present in file properties.

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

Copilot AI changed the title [WIP] Add width and height properties in ActivityPub for image attachments Enhance ActivityPub image attachments with width/height metadata Jun 10, 2026
Copilot AI requested a review from syuilo June 10, 2026 12:22
Comment thread CHANGELOG.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wrong insertion point; append changelog directly in 2026.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[feature] Include width and height properties in ActivityPub for image attachments

3 participants