Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simple
- function inRange(x, min, max)
- {
- return x >= min && x <= max;
- }
- image.width = 10;
- image.height = 10;
- limits.minWidth = 5;
- limits.maxWidth = 5;
- limits.minHeight = 5;
- limits.maxHeight = 5;
- if (!inRange(image.width, limits.minWidth, limits.maxWidth) ||
- !inRange(image.height, limits.minHeight, limits.maxHeight)) {
- throw new Error("Image incorrect size");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement