src/helpers/util.js
/*
Estimate the aspect ratio based on width x height
*/
Estimate the aspect ratio based on width x height
Estimate the aspect ratio based on width x height
function estimateAspectRatio(width, height, errorAllowed, aspectRatio) {
  let ratio = width / height; 
  if (ratio in LOOKUP) {
    return LOOKUP[ratio] === aspectRatio
  }
  let closest = findClosest(RATIOS, ratio)
  if (Math.abs(closest - ratio) <= errorAllowed / 100) {
    return LOOKUP[closest] === aspectRatio
  }
  return false
}
function estimateAspectRatio ( width , height , errorAllowed , aspectRatio ) { let ratio = width / height ; if ( ratio in LOOKUP ) { return LOOKUP [ ratio ] === aspectRatio } let closest = findClosest ( RATIOS , ratio ) if ( Math . abs ( closest - ratio ) <= errorAllowed / 100 ) { return LOOKUP [ closest ] === aspectRatio } return false }
Estimate the aspect ratio based on width x height
Estimate the aspect ratio based on width x height
// Look by approximation