Make WordPress Core


Ignore:
Timestamp:
01/10/2024 09:57:50 PM (13 months ago)
Author:
joedolson
Message:

Media: Fix handling of multibyte exif description metadata.

The exif standards expect the UserComment field to be used as a substitute for ImageDescription if multibyte characters are needed. WordPress media only mapped the ImageDescription field and did not correctly handle descriptions with multibyte characters.

Fix metadata saving to better handle media with multibyte characters in metadata and update unit tests.

Props fotodrachen, antpb, joedolson, mikinc860, azaozz, nicolefurlan.
Fixes #58082.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/meta.php

    r52269 r57267  
    5252        $this->assertSame( '', $out['credit'], 'Credit value not the same' );
    5353        $this->assertSame( 'NIKON D70', $out['camera'], 'Camera value not the same' );
    54         $this->assertSame( '', $out['caption'], 'Caption value not the same' );
     54        $this->assertSame( 'Copyright Alex Shiels', $out['caption'], 'Caption value not the same' );
    5555        $this->assertEquals( strtotime( '2007-06-17 21:18:00' ), $out['created_timestamp'], 'Timestamp value not equivalent' );
    5656        $this->assertSame( '', $out['copyright'], 'Copyright value not the same' );
     
    5858        $this->assertEquals( 0, $out['iso'], 'Iso value not equivalent' ); // Interesting - a Nikon bug?
    5959        $this->assertEquals( 1 / 500, $out['shutter_speed'], 'Shutter speed value not equivalent' );
    60         $this->assertSame( '', $out['title'], 'Title value not the same' );
     60        $this->assertSame( 'Copyright Alex Shiels', $out['title'], 'Title value not the same' );
    6161        // $this->assertSame( array( 'Flowers' ), $out['keywords'] );
    6262    }
Note: See TracChangeset for help on using the changeset viewer.