Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreachable code #154

Open
Billy- opened this issue Jul 1, 2014 · 0 comments
Open

Unreachable code #154

Billy- opened this issue Jul 1, 2014 · 0 comments

Comments

@Billy-
Copy link

Billy- commented Jul 1, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant