Make WordPress Core

Opened 3 years ago

Last modified 15 months ago

#32378 new defect (bug)

Image Uploads automatically puts "Olympus Digital Camera" as caption

Reported by: vparkhere Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.2
Component: Media Keywords: dev-feedback needs-unit-tests has-patch
Focuses: Cc:

Description (last modified by azaozz)

Images from Olympus cameras are automatically given the caption "Olympus Digital Camera."

Steps to reproduce:

1) Upload image that came from Olympus camera 2) Alternative text and caption are automatically filled in with OLYMPUS DIGITAL CAMERA

3) Published image displays grey border with caption OLYMPUS DIGITAL CAMERA

WordPress isn't alone in this issue; Flickr, Picasa, Windows Live Movie Maker users have also reported the same thing happening when they upload images.

This may be due to #22768, there appears to be code for media to “Use image exif/iptc data for title and caption defaults if possible.”

This is an image that was uploaded May 5th:

And this was uploaded May 7th, after the update:

A similar ticket where EXIF/IPTC captions populate description/post_content: #22768

Attachments (7)

automaticcaption.png (139.5 KB) - added by vparkhere 3 years ago.
nocaption.png (486.6 KB) - added by vparkhere 3 years ago.
caption.png (486.5 KB) - added by vparkhere 3 years ago.
32378.patch (1.5 KB) - added by dmsnell 3 years ago.
Remove OLYMPUS DIGITAL CAMERA and use file name if present
P1010013.JPG (426.9 KB) - added by azaozz 2 years ago.
32378-2.patch (5.7 KB) - added by dmsnell 15 months ago.
add generalized system for replacing unwanted default image metadata
32378-3.patch (5.7 KB) - added by dmsnell 15 months ago.
oops - fix: spaces -> tabs

Download all attachments as: .zip

Change History (24)

3 years ago

3 years ago

#1 @SergeyBiryukov
3 years ago

  • Description modified (diff)
  • Version set to 4.2

#2 @azaozz
3 years ago

  • Description modified (diff)

#3 @azaozz
3 years ago

  • Milestone changed from Awaiting Review to 4.2.3

@vparkhere thanks for the detailed bug report :)

Yeah, introduced in [31694] (#22768). Not sure if it is going to be enough to just remove OLYMPUS DIGITAL CAMERA when it ends up as caption, or have a deeper look at which EXIF fields can be used.

#4 @dd32
3 years ago

  • Milestone changed from 4.2.3 to 4.3

I'm shifting to 4.3, pending a patch into trunk which we can consider merging into 4.2.x

3 years ago

Remove OLYMPUS DIGITAL CAMERA and use file name if present

#5 @dmsnell
3 years ago

  • Keywords has-patch dev-feedback added

Some investigation revealed that this default metadata is bugging people on plenty of other services. I downloaded some sample images from different Olympus cameras and the data appeared fairly consistent.

I think that we should go ahead and remove the string when we find it and use other information if available. The Olympus cameras store the original filename in another field, which we should be able to use to match the behavior with other camera vendors.

The description field gets totally overwritten and I didn't see any obvious alternatives that Olympus is using. Regardless, if the user has modified these fields, this data will not be overwritten.

#6 @wonderboymusic
3 years ago

  • Keywords needs-refresh added; has-patch removed

@dmsnell few things:

add_action|filter() calls need to go into wp-admin/includes/admin-filters.php

It seems like the list of string we would want to replace will grow. Can you write the function to be more generic and optionally include a way to add more strings to a list of strings to be replaced?

#7 @obenland
3 years ago

  • Milestone changed from 4.3 to Future Release

Let's try again in a future release.

This ticket was mentioned in Slack in #core-images by ocean90. View the logs.

2 years ago

2 years ago

#9 @azaozz
2 years ago

P1010013.JPG is a photo shot with a very old Olympus camera that triggers this error.

EXIF data in it:

Filename - P1010013.JPG
Model - C2Z,D520Z,C220Z 
Orientation - Top left
XResolution - 144
YResolution - 144
ResolutionUnit - Inch
Software - 83-1056
DateTime - 0000:00:00 00:00:00
YCbCrPositioning - Co-Sited
ExifOffset - 146
ExposureTime - 1/200 seconds
FNumber - 2.80
ExposureProgram - Normal program
ISOSpeedRatings - 80
ExifVersion - 0210
DateTimeOriginal - 0000:00:00 00:00:00
DateTimeDigitized - 0000:00:00 00:00:00
ComponentsConfiguration - YCbCr
ExposureBiasValue - 0.00
MaxApertureValue - F 2.83
MeteringMode - Multi-segment
Flash - Not fired
FocalLength - 5.00 mm
UserComment - 
FlashPixVersion - 0100
ColorSpace - sRGB
ExifImageWidth - 1600
ExifImageHeight - 1200
InteroperabilityOffset - 482
FileSource - DSC - Digital still camera

Maker Note (Vendor): - 
Mode - Normal
JpegQual - High
Macro - Off
DigiZoom - 1.00 x
Software Release - D4083
Flash mode - Not used
Manual focus - No
Focus distance - 0.00
Sharpness - Normal
White Balance - Auto
Contrast - Normal
Image Width - 1600
Image Height - 1200

Thumbnail: - 
Compression - 6 (JPG)
XResolution - 72
YResolution - 72
ResolutionUnit - Inch
JpegIFOffset - 6566
JpegIFByteCount - 5775
Last edited 2 years ago by azaozz (previous) (diff)

#10 @tpnotes
2 years ago

  • Keywords 2nd-opinion added

I stumbled upon this ticket yesterday and I am still startled, that anyone is thinking about working around a bug in the software of a camera manufacturer with a customization of Wordpress core. It is a default setting of the image description metadata field of the EXIF, that can not be changed in the camera settings of Olympus cameras. WordPress is working correctly and puts the image description in the appropriate field.

I own an E-M1 myself and know about that issue, since I shot my first pics with it. But instead of expecting any software I use should fix this for me, I correct the EXIFs by myself in my image processing workflow. And I strongly believe that's the right way to handle this.

BTW: has anyone got in touch with Olympus about that?

#11 @swissspidy
16 months ago

  • Keywords needs-unit-tests needs-patch added; needs-refresh 2nd-opinion removed

I'm a bit on the fence. I tend to agree that this is a rare situation as it only applies to older Olympus camera models. 32378.patch might be better put in a plugin, but people would probably not even know that there's a plugin to fix this and blame WordPress for it. So why not make lives easier when we can do so easily? Of course it would be helpful if other cameras do the same and we can have some sort of blacklist to work with.

Anyway, for this to move forward, a refreshed patch with some tests using the photos uploaded to this ticket is needed.

#12 follow-up: @crabsandwich
15 months ago


I am by no means a WP developer and don't really understand if this has been fixed by a patch or not, but i wanted to add that this is not just a problem with old Olympus cameras. I have a relatively new camera (2016) and i still have this problem.

If this is not going to be added to WP, is it not possible to halt the over-write by the exif data by creating a script or even a plugin....

Any more WP orientated input on this topic would be much appreciated or would @tpnotes please aid me in batch editing exif's in photoshop for this purpose.

Thank you

#13 @crabsandwich
15 months ago

After submitting the last reply i found the following plugin


Works a treat on my Olympus photos

15 months ago

add generalized system for replacing unwanted default image metadata

#14 @dmsnell
15 months ago

The latest patch (https://core.trac.wordpress.org/attachment/ticket/32378/32378-2.patch) I just uploaded makes some big changes to the scope of this ticket: in addition to simply replacing the Olympus camera defaults it provides a generalized system for replacing unwanted image metadata, as requested by @wonderboymusic.

The new patch is much more complicated than the original one and I could just as easily see the extensibility coming in from adding more filters on wp_read_image_metadata instead of this new system. However, the new image_metadata_substitute_defaults() does provide a more straight-forward way of adding new substitutions that should hopefully be safer and easier for people to find and use.

There are no tests on this patch yet and I haven't even tested the code to see if it works. My goal in submitting it is to garner feedback on the implementation. The heart of the filter is testable outside of the WordPress environment and it should be trivial to add tests once we know if that's what we want to build.

I agree with what @swissspidy brought up: users shouldn't need to know that they have to look for a plugin in order to fix this and the behavior without a fix is likely to look like we misread the image data. My argument in favor of "fixing" this is that the information provided by default doesn't semantically match the EXIF fields it's stored in.

15 months ago

oops - fix: spaces -> tabs

#15 @swissspidy
15 months ago

  • Keywords has-patch added; needs-patch removed

That's pretty neat, thanks @dmsnell!

#16 in reply to: ↑ 12 @tpnotes
15 months ago

Replying to crabsandwich:

Any more WP orientated input on this topic would be much appreciated or would @tpnotes please aid me in batch editing exif's in photoshop for this purpose.

Access your images with Bridge, highlight any image you want und just delete the according entry in the metadata panel in the lower right.

If you use Lightroom for managing your images, you can define an import preset, which does it on import automatically.

#17 @tpnotes
15 months ago

I still argue against fiddling around with EXIF data with WordPress. It is not WordPress Business. I as a photographer want to have total control, which metadata are going with my images online and do not want any system to decide on its own, if those metadata are "appropriate".

Note: See TracTickets for help on using tickets.