From 27574f85414ba0fa1f8f628d64b7eef684a8aa22 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sat, 12 Oct 2019 20:50:48 +1100 Subject: [PATCH] Ensure Photon strips only 'info' not 'all' when inserting SrcSet --- extensions/blocks/tiled-gallery/tiled-gallery.php | 4 ++-- extensions/blocks/tiled-gallery/utils/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/blocks/tiled-gallery/tiled-gallery.php b/extensions/blocks/tiled-gallery/tiled-gallery.php index 42282e8ee7989..d53feae4ab4e7 100644 --- a/extensions/blocks/tiled-gallery/tiled-gallery.php +++ b/extensions/blocks/tiled-gallery/tiled-gallery.php @@ -89,7 +89,7 @@ public static function render( $attr, $content ) { $srcset_src = add_query_arg( array( 'resize' => $w . ',' . $w, - 'strip' => 'all', + 'strip' => 'info', ), $orig_src ); @@ -108,7 +108,7 @@ public static function render( $attr, $content ) { for ( $w = $min_width; $w <= $max_width; $w = min( $max_width, $w + self::IMG_SRCSET_WIDTH_STEP ) ) { $srcset_src = add_query_arg( array( - 'strip' => 'all', + 'strip' => 'info', 'w' => $w, ), $orig_src diff --git a/extensions/blocks/tiled-gallery/utils/index.js b/extensions/blocks/tiled-gallery/utils/index.js index d6b647a50afdb..592ef6668a7d6 100644 --- a/extensions/blocks/tiled-gallery/utils/index.js +++ b/extensions/blocks/tiled-gallery/utils/index.js @@ -86,7 +86,7 @@ export function photonizedImgProps( img, galleryAtts = {} ) { .map( srcsetWidth => { const srcsetSrc = photonImplementation( url, { resize: `${ srcsetWidth },${ srcsetWidth }`, - strip: 'all', + strip: 'info', } ); return srcsetSrc ? `${ srcsetSrc } ${ srcsetWidth }w` : null; } ) @@ -99,7 +99,7 @@ export function photonizedImgProps( img, galleryAtts = {} ) { srcSet = range( minWidth, maxWidth, step ) .map( srcsetWidth => { const srcsetSrc = photonImplementation( url, { - strip: 'all', + strip: 'info', width: srcsetWidth, } ); return srcsetSrc ? `${ srcsetSrc } ${ srcsetWidth }w` : null;