Ticket #39387: miqro-39387.diff
File miqro-39387.diff, 1.3 KB (added by , 8 years ago) |
---|
-
src/wp-includes/media.php
1069 1069 1070 1070 $image_basename = wp_basename( $image_meta['file'] ); 1071 1071 1072 /** 1073 * Filters the on/off behavior of responsive images when a GIF is used. 1074 * 1075 * @since 4.8.0 1076 * 1077 * @param bool $make_gifs_responsive Set this to true if you want all GIF images to have responsive srcset. 1078 */ 1079 $make_gifs_responsive = apply_filters( 'wp_calculate_image_srcset_gif', false ); 1080 1072 1081 /* 1073 1082 * WordPress flattens animated GIFs into one frame when generating intermediate sizes. 1074 1083 * To avoid hiding animation in user content, if src is a full size GIF, a srcset attribute is not generated. 1075 1084 * If src is an intermediate size GIF, the full size is excluded from srcset to keep a flattened GIF from becoming animated. 1076 1085 */ 1077 if ( ! isset( $image_sizes['thumbnail']['mime-type'] ) || 'image/gif' !== $image_sizes['thumbnail']['mime-type'] ) {1086 if ( $make_gifs_responsive || ! isset( $image_sizes['thumbnail']['mime-type'] ) || 'image/gif' !== $image_sizes['thumbnail']['mime-type'] ) { 1078 1087 $image_sizes[] = array( 1079 1088 'width' => $image_meta['width'], 1080 1089 'height' => $image_meta['height'],