PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-image-cdn/src/class-image-cdn.php +7 -3 16.2 → 16.3 View file →
@@ -11,9 +11,9 @@
11 11 * Class Image_CDN
12 12 */
13 13 final class Image_CDN {
14 14
15 - const PACKAGE_VERSION = '0.8.0';
15 + const PACKAGE_VERSION = '0.8.1';
16 16
17 17 /**
18 18 * Singleton.
19 19 *
@@ -843,9 +843,13 @@
843 843 $image_meta = wp_get_attachment_metadata( $attachment_id );
844 844
845 845 if ( isset( $image_meta['width'] ) && isset( $image_meta['height'] ) ) {
846 846 $image_resized = image_resize_dimensions( $image_meta['width'], $image_meta['height'], $image_args['width'], $image_args['height'], $image_args['crop'] );
847 - if ( $image_resized ) { // This could be false when the requested image size is larger than the full-size image.
847 + if (
848 + $image_resized // This could be false when the requested image size is larger than the full-size image.
849 + && isset( $image_resized[6] ) // This key can be manipulated by the `image_resize_dimensions` filter
850 + && isset( $image_resized[7] ) // This key can be manipulated by the `image_resize_dimensions` filter
851 + ) {
848 852 $image_meta['width'] = $image_resized[6];
849 853 $image_meta['height'] = $image_resized[7];
850 854 }
851 855 }
@@ -1085,9 +1089,9 @@
1085 1089 $newsources = null;
1086 1090
1087 1091 foreach ( $multipliers as $multiplier ) {
1088 1092
1089 - $newwidth = $base * $multiplier;
1093 + $newwidth = (int) round( $base * $multiplier );
1090 1094 foreach ( $currentwidths as $currentwidth ) {
1091 1095 // If a new width would be within 100 pixes of an existing one or larger than the full size image, skip.
1092 1096 if ( abs( $currentwidth - $newwidth ) < 50 || ( $newwidth > $fullwidth ) ) {
1093 1097 continue 2; // Bump out back to the $multipliers as $multiplier.