def show(self, columSize: int = 10, linesHalt: int = -1): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' print(txt1) print(txt2) print("") s2hex(dataBytes=self.s2_all_data, dataName=Kind.findType(self.s0_app_marker).shortname, columnSize=columSize, linesHalt=linesHalt)
def showAll(self): txt1_format = "\t{:<21} : '{}' {}" txt1_tmp1 = "(-" + Kind.findType( bytesData=self.s0_app_marker).shortname + "-)" txt1 = txt1_format.format('App Marker', self.s0_app_marker.hex(sep=' '), txt1_tmp1) txt2_tmp1 = '(' + str(clength(data=self.s1_app_length)) + ' bayt)' txt2 = txt1_format.format('App Length', self.s1_app_length.hex(sep=' '), txt2_tmp1) txt3 = txt1_format.format('JFXX Marker', self.s2_jfxx_marker.hex(sep=' '), "'JFXX\\x00'") if self.s3_jfxx_thumbnail_format == b'10': txt4_tmp1 = '(-JPEG format-)' elif self.s3_jfxx_thumbnail_format == b'11': txt4_tmp1 = '(-1 byte per pixel palettized format-)' elif self.s3_jfxx_thumbnail_format == b'13': txt4_tmp1 = '(-3 byte per pixel RGB format-)' else: txt4_tmp1 = '(?)' txt4 = txt1_format.format('JFXX Thumbnail Format', self.s3_jfxx_thumbnail_format.hex(), txt4_tmp1) print(txt1) print(txt2) print(txt3) print(txt4) s2hex(dataBytes=self.s4_jfxx_thumbnail_data, dataName="'JFXX Thumbnail Data'", columnSize=20)
def show(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tAdobe_CM Marker : ' + self.s2_adobe_marker.hex( sep=' ') + " '" + self.s2_adobe_marker_str + "'" print(txt1) print(txt2) print(txt3) if len(self.s3_all_data) >= 14: txt4 = '\tAdobe_CM Starter : ' + self.s3_all_data[13:14].hex( sep=' ') print(txt4) print() s2hex(dataBytes=self.s3_all_data, dataName=Kind.findType(self.s0_app_marker).shortname, columnSize=20)
def all(self) -> str: txt1_format = "\t{:<20} : '{}' {}" txt1_tmp1 = "(-" + Kind.findType( bytesData=self.s0_app_marker).shortname + "-)\n" txt1 = txt1_format.format('App Marker', self.s0_app_marker.hex(sep=' '), txt1_tmp1) txt2_tmp1 = '(' + str(clength(data=self.s1_app_length)) + ' bayt)\n' txt2 = txt1_format.format('App Length', self.s1_app_length.hex(sep=' '), txt2_tmp1) txt3 = txt1_format.format('JFIF Marker', self.s2_jfif_marker.hex(sep=' '), "'JFIF\\x00'\n") txt4_tmp1 = self.s3_jfif_version_1_major.hex( ) + ' ' + self.s3_jfif_version_2_minor.hex() txt4_tmp2 = '(' + str(ord(self.s3_jfif_version_1_major)) + '.' + str( ord(self.s3_jfif_version_2_minor)) + ')\n' txt4 = txt1_format.format('JFIF Version', txt4_tmp1, txt4_tmp2) if self.s4_jfif_density_units.lower() == '00': txt5_tmp1 = '(-No Units:::Pixel Aspect Ratio-)\n' elif self.s4_jfif_density_units.hex().lower() == '01': txt5_tmp1 = '(-Pixels Per Inch [2.54 cm]-)\n' elif self.s4_jfif_density_units.hex().lower() == '02': txt5_tmp1 = '(-Pixels Per Centimeter-)\n' else: txt5_tmp1 = '(?)\n' txt5 = txt1_format.format('JFIF Density Units', self.s4_jfif_density_units.hex(), txt5_tmp1) txt6 = txt1_format.format('JFIF X Density', self.s5_jfif_xdensity.hex(sep=' '), '\n') txt7 = txt1_format.format('JFIF Y Density', self.s6_jfif_ydensity.hex(sep=' '), '\n') txt8 = txt1_format.format('JFIF X Thumbnail', self.s7_jfif_xthumbnail.hex(sep=' '), '\n') txt9 = txt1_format.format('JFIF Y Thumbnail', self.s8_jfif_ythumbnail.hex(sep=' '), '\n') thumbnail_length = len(self.s9_jfif_thumbnaildata) txt2_format = "\t{:<20} : '{}" txt10 = '' for kk in range(0, thumbnail_length): if kk % 10 == 0: if kk == 0: txt10 = txt2_format.format( 'JFIF Thumbnail Data', self.s9_jfif_thumbnaildata[kk:kk + 1].hex()) else: txt10 += "'\n" + txt2_format.format( '', self.s9_jfif_thumbnaildata[kk:kk + 1].hex()) else: txt10 += ' ' + self.s9_jfif_thumbnaildata[kk:kk + 1].hex() if kk == thumbnail_length - 1: txt10 += "'" result = txt1 + txt2 + txt3 + txt4 + txt5 + txt6 + txt7 + txt8 + txt9 + txt10 return result
def show(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tAdobe Marker : ' + self.s2_adobe_marker.hex( sep=' ') + " '" + self.s2_adobe_marker_str + "'" print(txt1) print(txt2) print(txt3) if len(self.s3_all_data) >= 12: txt4 = '\tAdobe Starter : ' + self.s3_all_data[10:12].hex( sep=' ') + " '" + self.s3_all_data[10:11].hex( ) + " Bit - (" + self.s3_all_data[11:12].hex() + ")'" print(txt4) if len(self.s3_all_data) >= 16: txt5 = '\tAdobe Data : ' + self.s3_all_data[12:16].hex( sep=' ') print(txt5) print() s2hex(dataBytes=self.s3_all_data, dataName=Kind.findType(self.s0_app_marker).shortname, columnSize=20)
def showHeader(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tXMP Marker (Hex) : ' + self.s2_xmp_marker.hex(sep=' ') txt4 = '\tXMP Marker (Str) : "' + self.s2_xmp_marker_str + '"' txt5 = '\tXMP Encoding : ' + self.s3_xmp_encoding_str print(txt1) print(txt2) print(txt3) print(txt4) print(txt5)
def showHeader(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tExif Marker : ' + self.s2_exif_marker.hex( sep=' ') + " '" + self.s2_exif_marker_str + "'" txt4 = '\tExif Byte Order : ' + self.s3_exif_byte_order.hex( sep=' ') + " '" + self.s3_exif_byte_order.decode( encoding='Ascii', errors='replace') + "' '" + self.s3_exif_byte_order_str + "'" txt5 = '\tExif Version Number : ' + self.s4_exif_version_number.hex( sep=' ') + " (" + str(clength(self.s4_exif_version_number)) + ")" txt6 = '\tExif IFD : ' + self.s5_exif_image_file_directory_ifd.hex( sep=' ') txt7 = "\tExif 'OIFD' Tags Count : " + str( len(self.s6_exif_0IFD_3tags)) txt8 = "\tExif 'Exif IFD' Tags Count : " + str( len(self.s7_exif_ExifIFD_3tags)) txt9 = "\tExif 'Interoperability IFD' Tags Count : " + str( len(self.s8_exif_InterOperability_3tags)) txt10 = "\tExif 'GPS IFD' Tags Count : " + str( len(self.s9_exif_GpsIFD_3tags)) txt11 = "\tExif '1IFD' Tags Count : " + str( len(self.s10_exif_1IFD_3tags)) txt12 = "\t + " txt13 = "\t ----------- " txt14 = "\tExif Total Tags Count : " + str( len(self.s6_exif_0IFD_3tags) + len(self.s7_exif_ExifIFD_3tags) + len(self.s8_exif_InterOperability_3tags) + len(self.s9_exif_GpsIFD_3tags) + len(self.s10_exif_1IFD_3tags)) print(txt1) print(txt2) print(txt3) print(txt4) print(txt5) print(txt6) print() print(txt7) print(txt8) print(txt9) print(txt10) print(txt11) print(txt12) print(txt13) print(txt14)
def showAll(self): txt1_format = "\t{:<20} : '{}' {}" txt1_tmp1 = "(-" + Kind.findType( bytesData=self.s0_app_marker).shortname + "-)" txt1 = txt1_format.format('App Marker', self.s0_app_marker.hex(sep=' '), txt1_tmp1) txt2_tmp1 = '(' + str(clength(data=self.s1_app_length)) + ' bayt)' txt2 = txt1_format.format('App Length', self.s1_app_length.hex(sep=' '), txt2_tmp1) txt3 = txt1_format.format('JFIF Marker', self.s2_jfif_marker.hex(sep=' '), "'JFIF\\x00'") txt4_tmp1 = self.s3_jfif_version_1_major.hex( ) + ' ' + self.s3_jfif_version_2_minor.hex() txt4_tmp2 = '(' + str(ord(self.s3_jfif_version_1_major)) + '.' + str( ord(self.s3_jfif_version_2_minor)) + ')' txt4 = txt1_format.format('JFIF Version', txt4_tmp1, txt4_tmp2) if self.s4_jfif_density_units.lower() == '00': txt5_tmp1 = '(-No Units:::Pixel Aspect Ratio-)' elif self.s4_jfif_density_units.hex().lower() == '01': txt5_tmp1 = '(-Pixels Per Inch [2.54 cm]-)' elif self.s4_jfif_density_units.hex().lower() == '02': txt5_tmp1 = '(-Pixels Per Centimeter-)' else: txt5_tmp1 = '(?)' txt5 = txt1_format.format('JFIF Density Units', self.s4_jfif_density_units.hex(), txt5_tmp1) txt6 = txt1_format.format('JFIF X Density', self.s5_jfif_xdensity.hex(sep=' '), '') txt7 = txt1_format.format('JFIF Y Density', self.s6_jfif_ydensity.hex(sep=' '), '') txt8 = txt1_format.format('JFIF X Thumbnail', self.s7_jfif_xthumbnail.hex(sep=' '), '') txt9 = txt1_format.format('JFIF Y Thumbnail', self.s8_jfif_ythumbnail.hex(sep=' '), '') print(txt1) print(txt2) print(txt3) print(txt4) print(txt5) print(txt6) print(txt7) print(txt8) print(txt9) s2hex(dataBytes=self.s9_jfif_thumbnaildata, dataName="'JFIF Thumbnail Data'", columnSize=20)
def showParams(self, columnSize=50, linesHalt=-1): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tXMP Marker (Hex) : ' + self.s2_xmp_marker.hex(sep=' ') txt4 = '\tXMP Marker (Str) : "' + self.s2_xmp_marker_str + '"' txt5 = '\tXMP Encoding : ' + self.s3_xmp_encoding_str print(txt1) print(txt2) print(txt3) print(txt4) print(txt5) print("") # if self.s3_xmp_encoding_int == 1: sutf8(bytesData=self.s4_xmp_data.replace( self.s3_xmp_encoding_bytes, b'0xEF 0xBB 0xBF'), columnSize=columnSize, linesHalt=linesHalt) elif self.s3_xmp_encoding_int == 2: sutf16be(bytesData=self.s4_xmp_data.replace( self.s3_xmp_encoding_bytes, b'0xFE 0xFF'), columnSize=columnSize, linesHalt=linesHalt) elif self.s3_xmp_encoding_int == 3: sutf16le(bytesData=self.s4_xmp_data.replace( self.s3_xmp_encoding_bytes, b'0xFF 0XFE'), columnSize=columnSize, linesHalt=linesHalt) elif self.s3_xmp_encoding_int == 4: sutf32be(bytesData=self.s4_xmp_data.replace( self.s3_xmp_encoding_bytes, b'0x00 0x00 0xFE 0XFF'), columnSize=columnSize, linesHalt=linesHalt) elif self.s3_xmp_encoding_int == 5: suft32le(bytesData=self.s4_xmp_data.replace( self.s3_xmp_encoding_bytes, b'0xFF 0XFE 0x00 0x00'), columnSize=columnSize, linesHalt=linesHalt) else: print('\tData Encoding Unknown')
def showHeader(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tPhotoshop Marker (Hex) : ' + self.s2_photoshop_marker.hex( sep=' ') txt4 = '\tPhotoshop Marker (Str) : ' + self.s2_photoshop_marker_str txt5 = '\tPhotoshop Tags Count : ' + str( len(self.s3_photoshop_tags)) txt6 = '\t<<8BIM>4bayt> - <<Tag>2bayt> - <<Padding>2bayt>- <<Count>4bayt> - <<Data>Variable>' # print(txt1) print(txt2) print(txt3) print(txt4) print(txt5) print(txt6)
def all(self) -> str: txt1_format = "\t{:<21} : '{}' {}\n" txt1_tmp1 = "(-" + Kind.findType( bytesData=self.s0_app_marker).shortname + "-)" txt1 = txt1_format.format('App Marker', self.s0_app_marker.hex(sep=' '), txt1_tmp1) txt2_tmp1 = '(' + str(clength(data=self.s1_app_length)) + ' bayt)' txt2 = txt1_format.format('App Length', self.s1_app_length.hex(sep=' '), txt2_tmp1) txt3 = txt1_format.format('JFXX Marker', self.s2_jfxx_marker.hex(sep=' '), "'JFXX\\x00'") if self.s3_jfxx_thumbnail_format == b'10': txt4_tmp1 = '(-JPEG format-)' elif self.s3_jfxx_thumbnail_format == b'11': txt4_tmp1 = '(-1 byte per pixel palettized format-)' elif self.s3_jfxx_thumbnail_format == b'13': txt4_tmp1 = '(-3 byte per pixel RGB format-)' else: txt4_tmp1 = '(?)' txt4 = txt1_format.format('JFXX Thumbnail Format', self.s3_jfxx_thumbnail_format.hex(), txt4_tmp1) thumbnail_length = len(self.s4_jfxx_thumbnail_data) txt2_format = "\t{:<21} : '{}" txt5 = '' for kk in range(0, thumbnail_length): if kk % 10 == 0: if kk == 0: txt5 = txt2_format.format( 'JFIF Thumbnail Data', self.s4_jfxx_thumbnail_data[kk:kk + 1].hex()) else: txt5 += "'\n" + txt2_format.format( '', self.s4_jfxx_thumbnail_data[kk:kk + 1].hex()) else: txt5 += ' ' + self.s4_jfxx_thumbnail_data[kk:kk + 1].hex() if kk == thumbnail_length - 1: txt5 += "'" result = txt1 + txt2 + txt3 + txt4 + txt5 return result
def showHeader(self): txt1 = '\tApp Marker : ' + self.s0_app_marker.hex( sep=' ') + " '" + Kind.findType( self.s0_app_marker).shortname + "'" txt2 = '\tApp Length : ' + self.s1_app_length.hex( sep=' ') + ' (' + str(self.s1_app_length_int) + ' bayt)' txt3 = '\tMPF Marker : ' + self.s2_mpf_marker.hex( sep=' ') + " '" + self.s2_mpf_marker_str + "'" txt4 = '\tMPF Byte Order : ' + self.s3_mpf_byte_order.hex( sep=' ') + " '" + self.s3_mpf_byte_order.decode( encoding='utf-8', errors='replace') + "' (-" + self.s3_mpf_byte_order_str + "-)" txt5 = '\tMPF Version : ' + self.s4_mpf_version.hex(sep=' ') txt6 = '\tMPF IFD : ' + self.s5_mpf_IFD.hex(sep=' ') txt7 = '\tMPF IFD Tags Count : ' + self.s6_mpf_IFD_tags_count.hex( sep=' ') + " (" + str(self.s6_mpf_IFD_tags_count_int) + ")" print(txt1) print(txt2) print(txt3) print(txt4) print(txt5) print(txt6) print(txt7)
def showHex(self): self.showHeader() print() s2hex(dataBytes=self.s8_all_data, dataName=Kind.findType(self.s0_app_marker).shortname)