Adaptive-Images icon indicating copy to clipboard operation
Adaptive-Images copied to clipboard

Unreachable code

Open Billy- opened this issue 11 years ago • 0 comments

I'm not sure exactly what the intent was, but line 271 in adaptive-images.php will never evaluate to true, and thus line 272 will never be reached.

  // the required image width is bigger than any existing value in $resolutions
  if($total_width > $resolutions[0]){
    // firstly, fit the CSS size into a break point ignoring the multiplier
    foreach ($resolutions as $break_point) { // filter down
    // >>> If you are here, $total_width is > $resolutions[0] (the highest value in $resolutions), so the below will never be true.
      if ($total_width <= $break_point) { 
        $resolution = $break_point;
      }
    }
    // now apply the multiplier
    $resolution = $resolution * $pixel_density;
  }

Hope this helps

Billy- avatar Jul 01 '14 15:07 Billy-