We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should add a helper to check the orientation of media. A helper is needed to account for the non-intuitive (but correct) EXIF orientation values.
Here is a proposed implementation:
function ISPORTRAIT(value) { var width = value.width; var height = value.height; // photos if (value.orientation === 6 || value.orientation === 8) { width = value.height; height = value.width; } // videos if (value.orientation === 90 || value.orientation === 270) { width = value.height; height = value.width; } return width < height; }
Usage:
ON('add-photo', 'photos', function(event) { if (ISMOBILE() && ISPORTRAIT(event.value)) { INVALID('Please retake the photo in landscape orientation.'); } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should add a helper to check the orientation of media. A helper is needed to account for the non-intuitive (but correct) EXIF orientation values.
Here is a proposed implementation:
Usage:
The text was updated successfully, but these errors were encountered: