Added media_aspect_ratio util

This commit is contained in:
mgabdev 2019-08-23 00:00:10 -04:00
parent a8bef0faab
commit 5f366a013a

View File

@ -0,0 +1,17 @@
export const minimumAspectRatio = .8;
export const maximumAspectRatio = 2.8;
export const isPanoramic = ar => {
if (isNaN(ar)) return false;
return ar >= maximumAspectRatio;
}
export const isPortrait = ar => {
if (isNaN(ar)) return false;
return ar <= minimumAspectRatio;
}
export const isNonConformingRatio = ar => {
if (isNaN(ar)) return false;
return !isPanoramic(ar) && !isPortrait(ar);
}