-
Notifications
You must be signed in to change notification settings - Fork 83
Add EXIF metadata support for image attachments #2751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
…space. Adds support for extracting and including EXIF data from images in ActivityPub image attachments using the Vernissage namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds EXIF metadata support for ActivityPub image attachments by implementing the Vernissage namespace specification. The implementation extracts WordPress image metadata and converts it to standardized EXIF properties that are included in ActivityPub JSON output for image attachments.
Changes:
- Added EXIF data extraction and formatting in the Base transformer class
- Added Vernissage namespace context to ActivityPub objects
- Added comprehensive test coverage for EXIF metadata handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/transformer/class-base.php | Implements get_exif_data() method to extract and format EXIF metadata, and integrates it into transform_attachment() |
| includes/activity/class-base-object.php | Adds Vernissage namespace (photos) and EXIF context to ActivityPub JSON-LD |
| tests/phpunit/tests/includes/transformer/class-test-post.php | Adds five test cases covering EXIF data extraction, formatting, filtering, and integration |
| .github/changelog/2751-from-description | Documents the feature addition for changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
- Change property from 'exif' (Vernissage) to 'exifData' (Schema.org) - Use array of PropertyValue objects with @type, name, and value - Update JSON-LD context to use schema.org vocabulary - Field names now follow FEP-ee3a: DateTime, ExposureTime, FNumber, FocalLength, PhotographicSensitivity, Model - DateTime format changed to EXIF standard "YYYY:MM:DD HH:MM:SS" Reference: https://codeberg.org/fediverse/fep/pulls/750
Changed the default value of the $offset parameter from 0 to 5 in the schedule_outbox_activity_for_federation method to adjust the scheduling behavior.
…ation" This reverts commit 51dfe71.
Fixes #2759
Proposed changes:
PropertyValueobjects with@type,name, andvaluefields using theexifDataproperty.created_timestamp→DateTime(EXIF format "YYYY:MM:DD HH:MM:SS")shutter_speed→ExposureTime(fraction format like "1/100")aperture→FNumber(format like "f/2.8")focal_length→FocalLengthiso→PhotographicSensitivitycamera→Modelactivitypub_image_exiffilter for extending EXIF data (e.g., addingMake,LensModel, GPS coordinates)Other information:
Testing instructions:
?activitypubto the URL)exifDataarray with PropertyValue objectsExample expected output:
{ "type": "Image", "url": "https://example.com/image.jpg", "mediaType": "image/jpeg", "exifData": [ { "@type": "PropertyValue", "name": "DateTime", "value": "2024:01:01 00:00:00" }, { "@type": "PropertyValue", "name": "ExposureTime", "value": "1/100" }, { "@type": "PropertyValue", "name": "FNumber", "value": "f/2.8" }, { "@type": "PropertyValue", "name": "FocalLength", "value": "50" }, { "@type": "PropertyValue", "name": "PhotographicSensitivity", "value": "400" }, { "@type": "PropertyValue", "name": "Model", "value": "Canon EOS R5" } ] }Changelog entry
Changelog Entry Details
Significance
Type
Message
Add EXIF metadata support for image attachments (FEP-ee3a).