'Validate a specific icon path referenced in the manifest:
* Ensure that the file exists in the zip.
* Ensure that it is a valid PNG file.
* Ensure that it is square.
* Ensure that it has the claimed dimensions.'

def _validate_icon_file(self, icon_path, icon_size):

    try:
        icon_contents = self.zipfile.extract_path(icon_path.lstrip('/'))
    except KeyError:
        self.error('ICON_DOES_NOT_EXIST', icon_path=icon_path)
    try:
        if (imghdr.what(None, icon_contents) != 'png'):
            raise IOError
        image = Image.open(StringIO(icon_contents))
    except IOError:
        self.error('ICON_NOT_A_VALID_IMAGE_OR_PNG', icon_path=icon_path)
    if (image.size[0] != image.size[1]):
        self.error('ICON_NOT_SQUARE', icon_path=icon_path)
    if (icon_size != image.size[0]):
        self.error('ICON_INCORRECT_DIMENSIONS', icon_path=icon_path, icon_size=icon_size)
