Пример #1
0
 def __init__(self):
     from lib.image.jpg.sector import Sector
     from lib.image.jpg.app.APPTAG import APPTAG as App
     self.e1_sector_check = False
     self.e1_sector = Sector()
     self.e2_app_check = False
     self.e2_app = App( Sector(),b'' )
 def __init__(self, jpgBytes:bytes, filename:str=''):
     self.filename = filename
     self.bytes   = jpgBytes
     self.sectors = []
     self.apps    = []
     tmp_sectors =  findSectors(jpgBytes=self.bytes)
     count = 0
     for ii_sector in tmp_sectors:
         if 1 < ii_sector.type.no < 19 :
             ii_sector.applistno = count
             tmp_app = App( sector=ii_sector ,bytesData=self.bytes[ii_sector.start:ii_sector.end] )
             self.apps.append( tmp_app )
             count += 1
         self.sectors.append(ii_sector)
 def findAppUsingElementIndex(self, index: int) -> App:
     for ii_app in self.apps:
         if ii_app.a0_sector.no == index:
             return ii_app
     return App(sector=Sector(), bytesData=b'')
 def func3_findAllApp(self, index: int) -> App:
     if len(self.apps) >= index > 0:
         return self.apps[(index - 1)]
     else:
         return App(Sector(), bytesData=b'')