Opened 2 years ago
Last modified 2 years ago
#57821 new defect (bug)
Media library badly autopopulates image caption if Windows image metadata exists
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.1.1 |
Component: | Media | Keywords: | has-testing-info has-screenshots |
Focuses: | administration | Cc: |
Description
If you upload an image which has specific metadata (Properties → Comments filled out on a Windows computer, with the Properties → Title field blank), the caption on the image in WP Admin autopopulates with a string of question marks.
Steps to reproduce
- On Windows, edit an image's properties in the file explorer so that the Comments field is populated, but the Title field is not.
- Upload the image to any site
What you expected to happen
The caption field in the Media library should either stay blank, or contain the actual "Comments" field contents.
What actually happened
The caption field for that file contains a string of question marks as long as your original comment text.
Attachments (3)
Change History (6)
@
2 years ago
Zip file including two images, marked as 'buggy' and 'notbuggy'. It's the same image, and 'buggy' has the field 'Comments' updated using Windows properties dialog.
#1
@
2 years ago
Some additional findings
- The properties field stores an EXIF tag called XPComment
- I tried with different system locales, and was able to reproduce with English(US), English(India), and English(UK)
- I tried to use exiftool to add an XPcomment field to an image, which has never touched Windows, and that didn't show this bug
exiftool -XPComment="some comment" 20221210_1352181.jpg
- I found some documentation here about these tags ( https://exiv2.org/tags.html)
- I updated the XPcomment tag on my reference image with exiftool, but the bug was still reproduced.
Output from the file
command on both images attached to this ticket
❯ file buggy.jpg
buggy.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=15, manufacturer=FUJIFILM, model=X-E2S, orientation=upper-left, xresolution=2270, yresolution=2278, resolutionunit=2, software=Photos 0.2.4, datetime=2017:01:07 21:28:38], baseline, precision 8, 4896x3264, components 3
❯ file notbuggy.jpg
notbuggy.jpg: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=13, manufacturer=FUJIFILM, model=X-E2S, orientation=upper-left, xresolution=186, yresolution=194, resolutionunit=2, software=Photos 0.2.4, datetime=2017:01:07 21:28:38], baseline, precision 8, 4896x3264, components 3
This field is likely required to be encoded in a weird encoding called [UCS2](https://en.wikipedia.org/wiki/Universal_Coded_Character_Set), which is similar to UTF-16, but different.
#2
@
2 years ago
Test Report
It is working fine with my images. But the buggy image share in the ticket reproduces the issue.
Env
- WordPress 6.1.1
- Chrome 111.0.5563.64
- Mac OX Ventura version 13.2
- Theme: Twenty Twenty Three
- Media Library
Steps to test
- Download the images shared by the user and uploaded them to the media library
- Found the bug with that Image.
- Tried Changing the comment for my image and uploaded the same.
- But not found any issues.
- Replicated scenarios 2-3 with different images but not found any issues.
Screencast example:
Image giving issue - https://prnt.sc/gPsCslAXDENI
Screenshot of Windows properties dialog, showing the comments field