Changeset 12023 for sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php
- Timestamp:
- 08/19/2022 03:31:47 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php
r11702 r12023 102 102 103 103 /* After upload, after photo validates. */ 104 105 // Disable jpeg to webp converstion. 106 add_filter( 'wp_upload_image_mime_transforms', [ __CLASS__, 'disable_jpeg_to_wepb' ] ); 104 107 105 108 // Set post fields for photo. … … 791 794 } 792 795 } 796 797 /** 798 * Disable conversion of uploaded jpegs to webp. 799 * 800 * This is required as webp appears to use a lot of memory for conversion, often running out 801 * of memory during upload on WordPress.org. Additionally, we don't use/expose webp at present. 802 * This may be only required temporarily, see the below Core Trac ticket for confirmation. 803 * 804 * @see https://meta.trac.wordpress.org/ticket/6142 805 * @see https://core.trac.wordpress.org/ticket/55443 806 * 807 * @param array $transforms The mime type transforms for uploads. 808 * @return array The modified $transforms. 809 */ 810 public static function disable_jpeg_to_wepb( $transforms ) { 811 if ( isset( $transforms['image/jpeg'] ) ) { 812 $transforms['image/jpeg'] = [ 'image/jpeg' ]; 813 } 814 815 return $transforms; 816 } 793 817 } 794 818
Note: See TracChangeset
for help on using the changeset viewer.