diff --git a/docs/NEWS b/docs/NEWS index f219e0be..648154e8 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,3 +1,9 @@ + * Make it possible for plugins to let the core skip the check + whether trackbacks are already sent, with + $serendipity['skip_trackback_check'] + * Add the original image to the response images srcset when + the original image is small, to avoid upscaling + Version 2.4-alpha1 () ------------------------------------------------------------------------ diff --git a/plugins/serendipity_event_responsiveimages/serendipity_event_responsiveimages.php b/plugins/serendipity_event_responsiveimages/serendipity_event_responsiveimages.php index 80bb46a9..edfc5597 100644 --- a/plugins/serendipity_event_responsiveimages/serendipity_event_responsiveimages.php +++ b/plugins/serendipity_event_responsiveimages/serendipity_event_responsiveimages.php @@ -216,6 +216,12 @@ class serendipity_event_responsiveimages extends serendipity_event $srcset .= "{$thumbnailHttp} {$breakpoint}w,"; } } + // 2 == there is the original thumbnail without a dimension, and one thumbnail for the smallest breakpoint + if (count($thumbnails) == 2) { + // When the smallest thumbnail is the only responsive thumbnail our original image will be needed to as part of the srcset, otherwise we too often upscale the small thumbnail + $srcset .= "$imagePath {$origImage['dimensions_width']}w,"; + } + if (substr($srcset, -strlen(',')) === ',') { // we don't want to have the trailing comma $srcset = substr($srcset, 0, -1);