def size(self):
        self.fp.seek(0)

        self.fp.read(2)

        b = self.fp.read(1)
        try:
            while (b and ord(b) != 0xDA):
                while (ord(b) != 0xFF): b = self.fp.read(1)
                while (ord(b) == 0xFF): b = self.fp.read(1)
                if (ord(b) >= 0xC0 and ord(b) <= 0xC3):
                    self.fp.read(3)
                    h, w = struct.unpack(">HH", self.fp.read(4))
                    break
                else:
                    self.fp.read(int(struct.unpack(">H", self.fp.read(2))[0])-2)
                b = self.fp.read(1)
            width = int(w)
            height = int(h)
            
            return (width, height)
        except struct.error:
            pass
        except __HOLE__:
            pass
dataset/ETHPy150Open zynga/jasy/jasy/asset/ImageInfo.py/JpegFile.size