Make WordPress Core

Opened 4 years ago

Last modified 4 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 (8)

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

Download all attachments as: .zip

Change History (27)

4 years ago

4 years ago

#1 @SergeyBiryukov
4 years ago

  • Description modified (diff)
  • Version set to 4.2

#2 @azaozz
4 years ago

  • Description modified (diff)

#3 @azaozz
4 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
4 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

4 years ago

Remove OLYMPUS DIGITAL CAMERA and use file name if present

#5 @dmsnell
4 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
4 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
4 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.

3 years ago

3 years ago

#9 @azaozz
3 years ago

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

Version 0, edited 3 years ago by azaozz (next)

#10 @tpnotes
3 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
2 years 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
2 years 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
2 years ago

After submitting the last reply i found the following plugin


Works a treat on my Olympus photos

2 years ago

add generalized system for replacing unwanted default image metadata

#14 @dmsnell
2 years 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.

2 years ago

oops - fix: spaces -> tabs

#15 @swissspidy
2 years ago

  • Keywords has-patch added; needs-patch removed

That's pretty neat, thanks @dmsnell!

#16 in reply to: ↑ 12 @tpnotes
2 years 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
2 years 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".

11 months ago

#18 @mattday
11 months ago

Just wondering what needs to happen now for this to make it into core.

I appreciate it may be a non-issue for some professional photographers, although I believe it is a real annoyance for average users. Some people just want take a JPG file off their camera and upload it to their site. So it would be splendid if the title and caption were not automatically set to 'OLYMPUS DIGITAL CAMERA'.

The last patch by @dmsnell looks good to me. It is very generic and can still be applied without modification to 4.9.7. However, it did not work for me. In debugging, I found it was necessary to tweak the pattern strings slightly for the preg_match. I then tested on a number of images from different Olympus and non-Olympus cameras.

One thing I found through the testing was that taking the file name directly from the EXIF field is not ideal. The resulting names are inconsistent with images uploaded from other cameras, because they include the ".jpg" extension at the end. I further modified the patch to address this and have attached an updated version.

#19 @dmsnell
4 months ago

Thanks for that update @mattday.

@tpnotes as a photographer I think it would be surprising to intentionally store OLYMPUS DIGITAL CAMERA as the title for any image I store. The purpose here isn't to determine what "appropriate" is but rather to clean up bits that are obviously wrong and otherwise out of our control.

That is, it feels like this is solving a felt need by many people while posing a hypothetical problem for a subset. Do you feel differently?

Not sure how to make this move forward…

Note: See TracTickets for help on using tickets.