From 98912f15bbf8d4b6434163b3aff85c2148229e9f Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 29 Apr 2014 21:11:26 -0700 Subject: [PATCH] fix probably irrelevant issues with min_height etc. --- src/Posting/QR.coffee | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 5b4ac12c7..a2447de77 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -390,11 +390,11 @@ QR = img = new Image() img.onload = => {height, width} = img - if height > QR.max_heigth or width > QR.max_heigth - QR.error "#{file.name}: Image too large (image: #{img.height}x#{img.width}px, max: #{QR.max_heigth}x#{QR.max_width}px)" + if height > QR.max_height or width > QR.max_width + QR.error "#{file.name}: Image too large (image: #{img.height}x#{img.width}px, max: #{QR.max_height}x#{QR.max_width}px)" cb false - else if height < QR.min_heigth or width < QR.min_heigth - QR.error "#{file.name}: Image too small (image: #{img.height}x#{img.width}px, min: #{QR.min_heigth}x#{QR.min_width}px)" + else if height < QR.min_height or width < QR.min_width + QR.error "#{file.name}: Image too small (image: #{img.height}x#{img.width}px, min: #{QR.min_height}x#{QR.min_width}px)" cb false else cb true @@ -465,11 +465,13 @@ QR = } rules = $('ul.rules').textContent.trim() - QR.min_width = QR.min_heigth = 1 - QR.max_width = QR.max_heigth = 5000 + QR.min_width = QR.min_height = 1 + QR.max_width = QR.max_height = 5000 try - [_, QR.min_width, QR.min_heigth] = rules.match(/.+smaller than (\d+)x(\d+).+/) - [_, QR.max_width, QR.max_heigth] = rules.match(/.+greater than (\d+)x(\d+).+/) + [_, QR.min_width, QR.min_height] = rules.match(/.+smaller than (\d+)x(\d+).+/) + [_, QR.max_width, QR.max_height] = rules.match(/.+greater than (\d+)x(\d+).+/) + for prop in ['min_width', 'min_height', 'max_width', 'max_height'] + QR[prop] = parseInt QR[prop], 10 catch null