Bug 448185

Summary: SNCF physical ticket PDF417
Product: [Applications] KDE Itinerary Reporter: Nils <nils.van-zuijlen>
Component: generalAssignee: Volker Krause <vkrause>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: whole ter ticket photo
ter brest st-brieuc
tgv brest rennes

Description Nils 2022-01-09 22:49:54 UTC
Created attachment 145282 [details]
whole ter ticket photo

a physical ticket with a PDF417 barcode for a TER from St-Brieuc to Brest on 2022-01-01 for an under 26 years adult in 2nd class

It is a one-way ticket for any TER on that route on that day.
Comment 1 Nils 2022-01-09 22:57:43 UTC
Created attachment 145283 [details]
ter brest st-brieuc

TER from Brest to St-Brieuc on 2021-12-31 for any TER on that journey
Comment 2 Nils 2022-01-09 23:01:06 UTC
Created attachment 145284 [details]
tgv brest rennes

TGV ticket for  Brest-Rennes journey on train 8610 departing at 9h05 the 2022-01-03
Comment 3 Nils 2022-01-09 23:23:55 UTC
It would be nice to have a way to import such tickets via a photo or the barcode text read via other means.

There is an article (in french) about them and other on https://zestedesavoir.com/articles/3625/anatomie-dun-titre-de-transport-du-billet-a-la-carte-a-puce/#1-le-billet-cartonne-classique

They should be IATA-compatible, the norm they follow is available at https://www.era.europa.eu/sites/default/files/filesystem/tap/baseline_1.2.0_archive/era_technical_document_tap_b_6_v1.2.pdf

The ZXing library implements PDF417 decoding from pictures, it could be used as an example, I don't know if libre C++ libraries exist: https://github.com/zxing/zxing
Comment 4 Volker Krause 2022-01-10 16:49:53 UTC
Interesting material, this seems to be yet another type of barcode used by SNCF.

I can only decode the first two, zxing both on my workstation and on my phone fails on the third one unfortunately.

The first two contain a 171 byte binary payload in base64 encoding, which doesn't match the ERA SSB binary formats nor the ERA ELB format observed in TGV tickets (see also https://community.kde.org/KDE_PIM/KItinerary/SNCF_Barcodes). The latter is what the documents you linked to refer to as well, and which we already have support for.

So supporting this format depends mostly on either finding documentation about it, or getting a lot more samples hoping we can reverse-engineer it from those. That's a lot of work though, with no guarantee of success.