Skip to content

mrtd_fileread_write_image_to_file not robust enough #2

@justuswilhelm

Description

@justuswilhelm

mrtdreader will fail with the Couldn't find start of image error, at least for my German passport. After hotwiring fileread.c to always output the image, I found out that a JPEG2000 image is stored with offset 89, so that running

> tail -c +89 image.jpg > image_.jpg

will yield a correct file:

> file image_.jpg
image_.jpg: JPEG 2000 Part 1 (JP2)

I have no idea how other passports store their data, but perhaps running a simple linear search for 0000 000C 6A50 2020 0D0A 870A and the other JPEG headers will already suffice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions