Пример #1
0
    def _setup_mrtd(self, mrz):
        """
        3) Setup MRTD and get data
        """
        id_card = MRTD(mrz, True)

        self.personal_data = id_card.personal_data()

        if self.personal_data == None:
            sys.exit(1)

        self.image_base64 = id_card.photo_data()

        if self.image_base64 == None:
            sys.exit(1)
Пример #2
0
    def setup_mrtd(self):
        """
        3) Setup MRTD and get data
        """
        output_file = False
        id_card = MRTD(self.mrz, output_file)

        personal_data = id_card.personal_data()

        if personal_data == None:
            logging.error("DG1 could not be read")
            return False

        image_base64 = id_card.photo_data()

        if image_base64 == None:
            logging.error("DG2 could not be read")
            return False

        self.mrtd_data = [{
            'personal_data': personal_data
        }, {
            'image_base64': image_base64
        }]
Пример #3
0
    def get_data(self):

        if self.default_data:
            with open('config.json') as input:
                json_input = json.load(input)
                docNumber = json_input['docNumber']
                self.docNrEntry.insert(0, docNumber)
                dateOfBirth = json_input['dob']
                self.dobEntry.insert(0, dateOfBirth)
                expiryDate = json_input['expDate']
                self.expDateEntry.insert(0, expiryDate)

        docNumber = self.docNrEntry.get()
        dateOfBirth = self.dobEntry.get()
        expiryDate = self.expDateEntry.get()

        mrz = [docNumber, dateOfBirth, expiryDate]

        id = MRTD(mrz, False)

        personal_data = id.personal_data()

        image_base64 = id.photo_data('png')
        self.set_output(personal_data, image_base64)