File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
modules/images/webp-uploads Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,7 @@ function webp_uploads_create_sources_property( array $metadata, $attachment_id )
5555 $ metadata ['sources ' ] = array ();
5656 }
5757
58- if (
59- empty ( $ metadata ['sources ' ][ $ mime_type ] ) &&
60- in_array ( $ mime_type , $ valid_mime_transforms [ $ mime_type ], true )
61- ) {
58+ if ( empty ( $ metadata ['sources ' ][ $ mime_type ] ) ) {
6259 $ metadata ['sources ' ][ $ mime_type ] = array (
6360 'file ' => wp_basename ( $ file ),
6461 'filesize ' => wp_filesize ( $ file ),
@@ -137,12 +134,9 @@ function webp_uploads_create_sources_property( array $metadata, $attachment_id )
137134 $ properties ['sources ' ] = array ();
138135 }
139136
140- if (
141- in_array ( $ current_mime , $ valid_mime_transforms [ $ mime_type ], true ) &&
142- empty ( $ properties ['sources ' ][ $ current_mime ] )
143- ) {
137+ if ( empty ( $ properties ['sources ' ][ $ current_mime ] ) && isset ( $ properties ['file ' ] ) ) {
144138 $ properties ['sources ' ][ $ current_mime ] = array (
145- 'file ' => isset ( $ properties ['file ' ] ) ? $ properties [ ' file ' ] : '' ,
139+ 'file ' => $ properties ['file ' ],
146140 'filesize ' => 0 ,
147141 );
148142 // Set the filesize from the current mime image.
You can’t perform that action at this time.
0 commit comments