-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add EXIF metadata tests for Client Side Media #74909
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: feature/client-side-media-dev
Are you sure you want to change the base?
Add EXIF metadata tests for Client Side Media #74909
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 10.6 MB ℹ️ View Unchanged
|
63e8707 to
8383b9c
Compare
06436fb to
3b4a21c
Compare
3b4a21c to
37da852
Compare
|
Flaky tests detected in acd74f8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/21646747272
|
Expands test coverage for issue #74356 to ensure client-side media uploads preserve the same EXIF data as traditional server-side processing. New tests verify: - exif_orientation field is returned in REST API response - EXIF orientation is preserved when generate_sub_sizes=false - Full EXIF metadata (camera, aperture, ISO, focal length) is extracted - IPTC metadata (credit, caption, copyright, title) is extracted - Sideloading sub-sizes preserves original image_meta - Sideloaded sub-sizes have complete metadata (file, dimensions, mime, filesize) - exif_orientation is properly defined in REST API schema - Metadata consistency between server-side and client-side upload flows Also fixes a bug where EXIF orientation 0 (undefined/no EXIF data) was being returned instead of 1 (no rotation needed). The controller now treats orientation <= 0 as "no rotation needed". Co-Authored-By: Claude Opus 4.5 <[email protected]>
…ntroller-test.php Co-authored-by: Copilot <[email protected]>
306a8ad to
b3dbca7
Compare
The controller uses 'mime-type' (with hyphen) but the test was asserting against 'mime_type' (with underscore). Co-Authored-By: Claude Opus 4.5 <[email protected]>
The REST API converts 'mime-type' (hyphen) to 'mime_type' (underscore) for JSON API consistency in prepare_item_for_response(). The test assertions should use 'mime_type' to match the actual response format. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Links Gutenberg PR #74909 to WordPress Core backport PR #10868. Co-Authored-By: Claude Opus 4.5 <[email protected]>
andrewserong
left a comment
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.
Nice, this looks very thorough to me! Also TIL that EXIF orientation values begin at 1 👍
Closes #74356
Summary
Expands test coverage for #74356 to ensure client-side media uploads preserve the same EXIF data as traditional server-side processing.
New Tests
test_exif_orientation_field_returned_in_responseexif_orientationfield is in REST API responsetest_exif_orientation_returned_for_rotated_imagetest-image-upside-down.jpg(EXIF orientation 3)test_server_side_exif_rotation_disabled_for_client_side_processinggenerate_sub_sizes=falsetest_full_exif_metadata_extracted_for_client_side_uploadtest_exif_and_iptc_metadata_extractedtest_sideload_preserves_image_metatest_sideloaded_subsize_has_complete_metadatatest_exif_orientation_in_schemaexif_orientationis properly defined in REST API schematest_metadata_consistency_between_upload_flowsBug Fix
Fixes a bug where EXIF orientation
0(undefined/no EXIF data) was being returned instead of1(no rotation needed). The controller now treatsorientation <= 0as "no rotation needed".Test plan
npm run test:unit:php -- --filter="Gutenberg_REST_Attachments_Controller_Test"🤖 Generated with Claude Code