-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mrtd_fileread_write_image_to_file not robust enough #2
Comments
Hi, Are you using the latest mrtdreader version from GIT ? There is a linear search for 0x00,0x00,0x00,0x0c,0x6a,0x50,0x20,0x20,0x0d,0x0a already. The question is why does it not work for you. Does it never reach that sequence in your passport, or do you have one such sequence earlier in the file. Do you think you can find out? Best regards, |
I will let you know once I get the chance to fiddle with this again -- in January I will prepare a small presentation on ePassports. |
Hi, this is the output of the tool using my German passport:
|
@rubund Hi, same issue here. After digging into this issue, I found the filetype = file_content[73]; // 0x00: JPG, 0x01: JPEG2000 is |
Hi, this is JPEG2000 start sequence code details, from OpenCV issue(https://github.com/opencv/opencv/issues/19083).
So, add start sequence code 0xFF, 0x4F, 0xFF, 0x51 for file format "*.j2c".
If parsing a Chinese passport, |
mrtdreader will fail with the
Couldn't find start of image
error, at least for my German passport. After hotwiringfileread.c
to always output the image, I found out that a JPEG2000 image is stored with offset89
, so that runningwill yield a correct file:
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.The text was updated successfully, but these errors were encountered: