Changeset 52837 for trunk/src/wp-admin/includes/image.php
- Timestamp:
- 03/10/2022 01:08:19 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r52425 r52837 211 211 $image_meta['original_image'] = wp_basename( $original_file ); 212 212 213 // Add image file size. 214 $image_meta['filesize'] = wp_filesize( $new_file ); 215 213 216 return $image_meta; 214 217 } … … 236 239 // Default image meta. 237 240 $image_meta = array( 238 'width' => $imagesize[0], 239 'height' => $imagesize[1], 240 'file' => _wp_relative_upload_path( $file ), 241 'sizes' => array(), 241 'width' => $imagesize[0], 242 'height' => $imagesize[1], 243 'file' => _wp_relative_upload_path( $file ), 244 'filesize' => wp_filesize( $file ), 245 'sizes' => array(), 242 246 ); 243 247 … … 630 634 unset( $metadata['image']['data'] ); 631 635 636 // Capture file size for cases where it has not been captured yet, such as PDFs. 637 if ( ! isset( $metadata['filesize'] ) && file_exists( $file ) ) { 638 $metadata['filesize'] = wp_filesize( $file ); 639 } 640 632 641 /** 633 642 * Filters the generated attachment meta data.
Note: See TracChangeset
for help on using the changeset viewer.