Skip to content

Commit

Permalink
Correct faulty comparison in checking that a submitted PNG is greyscale.
Browse files Browse the repository at this point in the history
clarkn committed Sep 10, 2013
1 parent f97f821 commit 34a9983
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Views.py
Original file line number Diff line number Diff line change
@@ -1348,7 +1348,6 @@ def load_image(request):

#--------------------------------------------------------------------------
def confirm_grayscale(request):

AUTHENTICATE()

# Verify Image
@@ -1363,8 +1362,9 @@ def confirm_grayscale(request):

data = image_in.getdata()
bands = image_in.getbands()

if bands[:3] == 'RGB':

# if bands[:3] == 'RGB':
if bands[:3] == ('R','G','B'):
# Check that it's actually RGB, not grayscale stored as RGB
# If it's true RGB, fail.
for i in range(len(data)):
5 changes: 2 additions & 3 deletions templates/header_external.html
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

<div style = 'width: 990px; margin-left:auto;margin-right:auto; background : url("/media/lightgreen.jpg") ;padding-left:0px'>
<div style ='border:double; color:gold; border-width:10px; position:absolute; top:0; width: 976px;background-color:#057E19;height: 97px; overflow-x:hidden;overflow-y:hidden'>
<div style = 'margin-left: 30px ; margin-top: 0px;margin-right: 30px; margin-bottom: 0px; font-size:7px' >
<div style = 'margin-left: 30px ; margin-top: 0px;margin-right: 30px; margin-bottom: 0px; font-size:10px' >

<h1 style = 'color :white'>
<div style ='float:left; border:double; color:white; height:67px'>
@@ -25,8 +25,7 @@ <h1 style = 'color :white'>
Lost Person Model Rating System<br>
</center>
<div style = 'margin-top:18px'>
<div style ='font-size:14px;padding-left:265px;
position:absolute; width:95%'>
<div style ='font-size:12px;position:absolute; width:95%'>
<center>
[<a href="http://mapscore.sarbayes.org/main/"> Main </a>]
<i> *Main Menu* </i>

0 comments on commit 34a9983

Please sign in to comment.