def is_valid_image(self, raw_data):
        buf = StringIO(raw_data)
        try:
            trial_image = Image.open(buf)
            trial_image.verify()
        except Exception:
            # TODO: Get more specific with this exception handling.
            return False
        return True
Checks if the supplied raw data is valid image data.
dataset/ETHPy150Open gtaylor/django-athumb/athumb/pial/engines/pil_engine.py/PILEngine.is_valid_image