bigbuffet-rw/app/soapbox/utils/media-aspect-ratio.ts
Alex Gleason f20a8ab6fe Revert "Merge branch 'square' into 'develop'"
This reverts merge request !2027
2022-12-29 22:23:27 +00:00

17 lines
485 B
TypeScript

export const minimumAspectRatio = 9 / 16; // Portrait phone
export const maximumAspectRatio = 10; // Generous min-height
export const isPanoramic = (ar: number) => {
if (isNaN(ar)) return false;
return ar >= maximumAspectRatio;
};
export const isPortrait = (ar: number) => {
if (isNaN(ar)) return false;
return ar <= minimumAspectRatio;
};
export const isNonConformingRatio = (ar: number) => {
if (isNaN(ar)) return false;
return !isPanoramic(ar) && !isPortrait(ar);
};