def validate_bitmap(value):
 if (value is None):
  return
 if (value.file.content_type not in ALLOWED_IMAGES):
  raise ValidationError((_('Not supported image type: %s') % value.file.content_type))
 (width, height) = value.file.image.size
 if ((width > 2000) or (height > 2000)):
  raise ValidationError(_('Image is too big, please scale it down or crop relevant part!'))

def validate_bitmap ( value ) : if ( value is None ) : return if ( value . file . content_type not in ALLOWED_IMAGES ) : raise ValidationError ( ( _ ( 'Not supported image type: %s' ) % value . file . content_type ) ) ( width , height ) = value . file . image . size if ( ( width > 2000 ) or ( height > 2000 ) ) : raise ValidationError ( _ ( 'Image is too big, please scale it down or crop relevant part!' ) )
validates bitmap .