Changeset 31694 for trunk/src/wp-admin/includes/image.php
- Timestamp:
- 03/10/2015 05:06:39 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r31645 r31694 300 300 if ( ! empty( $iptc['2#120'][0] ) ) { // description / legacy caption 301 301 $caption = trim( $iptc['2#120'][0] ); 302 if ( empty( $meta['title'] ) ) { 303 mbstring_binary_safe_encoding(); 304 $caption_length = strlen( $caption ); 305 reset_mbstring_encoding(); 306 302 303 mbstring_binary_safe_encoding(); 304 $caption_length = strlen( $caption ); 305 reset_mbstring_encoding(); 306 307 if ( empty( $meta['title'] ) && $caption_length < 80 ) { 307 308 // Assume the title is stored in 2:120 if it's short. 308 if ( $caption_length < 80 ) { 309 $meta['title'] = $caption; 310 } else { 311 $meta['caption'] = $caption; 312 } 313 } elseif ( $caption != $meta['title'] ) { 314 $meta['caption'] = $caption; 309 $meta['title'] = $caption; 315 310 } 311 312 $meta['caption'] = $caption; 316 313 } 317 314 … … 347 344 // Assume the title is stored in ImageDescription 348 345 $meta['title'] = trim( $exif['ImageDescription'] ); 349 if ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) && trim( $exif['COMPUTED']['UserComment'] ) != $meta['title'] ) { 350 $meta['caption'] = trim( $exif['COMPUTED']['UserComment'] ); 351 } 352 } elseif ( empty( $meta['caption'] ) && trim( $exif['ImageDescription'] ) != $meta['title'] ) { 346 } 347 348 if ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) ) { 349 $meta['caption'] = trim( $exif['COMPUTED']['UserComment'] ); 350 } 351 352 if ( empty( $meta['caption'] ) ) { 353 353 $meta['caption'] = trim( $exif['ImageDescription'] ); 354 354 } 355 } elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) && trim( $exif['Comments'] ) != $meta['title']) {355 } elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) ) { 356 356 $meta['caption'] = trim( $exif['Comments'] ); 357 357 }
Note: See TracChangeset
for help on using the changeset viewer.