hannob / vacdec

Python script to decode the EU Covid-19 vaccine certificate
The Unlicense
242 stars 89 forks source link

IndexError: list index out of range when trying to decode a cert #17

Closed adrianharabula closed 2 years ago

adrianharabula commented 2 years ago

Hello, I get this when I try to decode a covid certificate:

Traceback (most recent call last):
  File "vacdec", line 13, in <module>
    cert = data[0].data.decode()
IndexError: list index out of range

It works with the test certificate image here.

hannob commented 2 years ago

There's little I can do without the failing cert. But if you look at the other bugs, it seems in some countries they use a different encoding of the certs, so this may be another variant.

adrianharabula commented 2 years ago

Is there a way to expose part of the cert data without exposing personal data? I have the QR code string decoded.

hannob commented 2 years ago

Not really, but if you're okay with it you can send it to me via mail: https://hboeck.de/en/contact.html

Alternatively you could check if there's an example cert from your country that we could use to analyze it.

hannob commented 2 years ago

From the code you sent me I think this is simply an image quality issue. The pyzbar qrcode library is not able to extract any data from that image. I'm also unable to scan the qrcode with a smartphone app. Maybe flatten the paper better or put it on a flatbet scanner will give better results?

I'll try to create a better error message with some rework I planned anyway.