Changeset 40130 for trunk/src/wp-admin/includes/image.php
- Timestamp:
- 02/27/2017 03:38:30 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r39617 r40130 252 252 253 253 if ( ! is_wp_error( $editor ) ) { // No support for this type of file 254 $uploaded = $editor->save( $file, 'image/jpeg' ); 254 /* 255 * PDFs may have the same file filename as JPEGs. 256 * Ensure the PDF preview image does not overwrite any JPEG images that already exist. 257 */ 258 $dirname = dirname( $file ) . '/'; 259 $ext = '.' . pathinfo( $file, PATHINFO_EXTENSION ); 260 $preview_file = $dirname . wp_unique_filename( $dirname, wp_basename( $file, $ext ) . '-pdf.jpg' ); 261 262 $uploaded = $editor->save( $preview_file, 'image/jpeg' ); 255 263 unset( $editor ); 256 264
Note: See TracChangeset
for help on using the changeset viewer.