Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your business will assume vast proportions.


sci / sci.crypt / Re: az - Telefax/OCR Test

SubjectAuthor
* Re: base26 Encoder/DecoderCri-Cri
+* Re: base26 Encoder/DecoderStefan Claas
|`* Re: base26 Encoder/DecoderCri-Cri
| `- Re: base26 Encoder/DecoderStefan Claas
`* Re: base26 Encoder/DecoderStefan Claas
 `* Re: base26 Encoder/DecoderStefan Claas
  +* Re: base26 Encoder/DecoderStefan Claas
  |`* Re: base26 Encoder/DecoderStefan Claas
  | `- Re: base26 Encoder/DecoderStefan Claas
  `* Re: base26 Encoder/DecoderCri-Cri
   `* Re: base26 Encoder/DecoderStefan Claas
    `* Re: base26 Encoder/DecoderCri-Cri
     `* Re: base26 Encoder/DecoderStefan Claas
      +- Re: base26 Encoder/DecoderStefan Claas
      `* Re: base26 Encoder/DecoderHerbert Kleebauer
       `* Re: base26 Encoder/DecoderStefan Claas
        +- Re: base26 Encoder/DecoderStefan Claas
        `* Re: base26 Encoder/DecoderHerbert Kleebauer
         +- Re: base26 Encoder/DecoderStefan Claas
         `* Re: base26 Encoder/DecoderStefan Claas
          `* Re: base26 Encoder/DecoderStefan Claas
           `* Re: az - Telefax/OCR Test (was: base26 Encoder/Decoder)Stefan Claas
            `* Re: az - Telefax/OCR TestHerbert Kleebauer
             `* Re: az - Telefax/OCR TestStefan Claas
              `* Re: az - Telefax/OCR TestHerbert Kleebauer
               `* Re: az - Telefax/OCR TestStefan Claas
                `* Re: az - Telefax/OCR TestStefan Claas
                 `* Re: az - Telefax/OCR TestStefan Claas
                  `- Re: az - Telefax/OCR TestStefan Claas

Pages:12
Subject: Re: az - Telefax/OCR Test
From: Stefan Claas
Newsgroups: sci.crypt
Organization: i2pn2 (i2pn.org)
Date: Wed, 1 May 2024 09:51 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: az - Telefax/OCR Test
Date: Wed, 1 May 2024 11:51:00 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <v0t3a4$2ovc1$1@i2pn2.org>
References: <uoekm1$3rhsc$1@i2pn2.org>
<g74JN.751237$mUo.609280@fx08.ams4>
<v0dtc5$276id$1@i2pn2.org>
<v0dup1$276id$2@i2pn2.org>
<7P6XN.610386$oD2.194358@fx11.ams4>
<v0j5oi$2ddq4$1@i2pn2.org>
<oknXN.41708$XrN3.19814@fx01.ams4>
<v0l0e2$2ff66$1@i2pn2.org>
<v0l9lf$10knh$1@dont-email.me>
<v0lc45$2ft6v$1@i2pn2.org>
<v0lgs1$125o7$1@dont-email.me>
<v0lo29$2gbvu$1@i2pn2.org>
<v0om6r$2juq5$1@i2pn2.org>
<v0r02u$2mfpi$1@i2pn2.org>
<v0rgfd$2l2q1$1@dont-email.me>
<v0suh6$2opr6$1@i2pn2.org>
<v0t2ei$33aat$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 May 2024 09:51:00 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2915713"; mail-complaints-to="usenet@i2pn2.org";
posting-account="uWi4uQdALkj7ETOfPbhNXfz0+Ra/gM5z6/Fa40dJi9U";
X-Spam-Checker-Version: SpamAssassin 4.0.0
Finger: tilde.club/~pollux/
View all headers

Herbert Kleebauer wrote:

> On 01.05.2024 10:29, Stefan Claas wrote:
>
> > I decoded the image and had one error in the certutil file
> > (one byte missing in one line at the end). The video was
> > also a certutil file, but with to many errors, so it wrote
> > a bad .mp4, which I could not decode.
> >
> > How did you manage to precisely insert 12 QR-Codes nicely on
> > an A4 page?
>
> Some time ago I wrote a batch to make a paper backup
> from a 13 kByte binary file (so it will make only two
> pages with 12 QR codes each). The input file is hard
> coded (t.jpg in this case). qrencode.exe I downloaded
> somewhere from the internet and convert.exe is the
> universal picture tool from https://imagemagick.org .
> split.exe just splits the input file in small chunks
> to be encoded in single QR code (source at the end of
> this post). To get the binary back from the paper print,
> you have just to start a text editor and scan all the
> QR codes with a Bluetooth QR code scanner (which works
> like an external Bluetooth keyboard). Then execute the
> generated batch file to generate the binary.

> [...]

Thanks a lot or your help, much appreciated!

Und einen schönen 1. Mai! :-)

--
Grüße
Regards
Stefan

Subject: Re: az - Telefax/OCR Test
From: Stefan Claas
Newsgroups: sci.crypt
Organization: i2pn2 (i2pn.org)
Date: Thu, 2 May 2024 14:10 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: az - Telefax/OCR Test
Date: Thu, 2 May 2024 16:10:49 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <v106ta$2sj59$1@i2pn2.org>
References: <uoekm1$3rhsc$1@i2pn2.org>
<g74JN.751237$mUo.609280@fx08.ams4>
<v0dtc5$276id$1@i2pn2.org>
<v0dup1$276id$2@i2pn2.org>
<7P6XN.610386$oD2.194358@fx11.ams4>
<v0j5oi$2ddq4$1@i2pn2.org>
<oknXN.41708$XrN3.19814@fx01.ams4>
<v0l0e2$2ff66$1@i2pn2.org>
<v0l9lf$10knh$1@dont-email.me>
<v0lc45$2ft6v$1@i2pn2.org>
<v0lgs1$125o7$1@dont-email.me>
<v0lo29$2gbvu$1@i2pn2.org>
<v0om6r$2juq5$1@i2pn2.org>
<v0r02u$2mfpi$1@i2pn2.org>
<v0rgfd$2l2q1$1@dont-email.me>
<v0suh6$2opr6$1@i2pn2.org>
<v0t2ei$33aat$1@dont-email.me>
<v0t3a4$2ovc1$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 2 May 2024 14:10:50 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3034281"; mail-complaints-to="usenet@i2pn2.org";
posting-account="uWi4uQdALkj7ETOfPbhNXfz0+Ra/gM5z6/Fa40dJi9U";
Finger: tilde.club/~pollux/
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

Stefan Claas wrote:

> Herbert Kleebauer wrote:
>
> > On 01.05.2024 10:29, Stefan Claas wrote:
> >
> > > I decoded the image and had one error in the certutil file
> > > (one byte missing in one line at the end). The video was
> > > also a certutil file, but with to many errors, so it wrote
> > > a bad .mp4, which I could not decode.
> > >
> > > How did you manage to precisely insert 12 QR-Codes nicely on
> > > an A4 page?
> >
> > Some time ago I wrote a batch to make a paper backup
> > from a 13 kByte binary file (so it will make only two
> > pages with 12 QR codes each). The input file is hard
> > coded (t.jpg in this case). qrencode.exe I downloaded
> > somewhere from the internet and convert.exe is the
> > universal picture tool from https://imagemagick.org .
> > split.exe just splits the input file in small chunks
> > to be encoded in single QR code (source at the end of
> > this post). To get the binary back from the paper print,
> > you have just to start a text editor and scan all the
> > QR codes with a Bluetooth QR code scanner (which works
> > like an external Bluetooth keyboard). Then execute the
> > generated batch file to generate the binary.
>
> > [...]
>
> Thanks a lot or your help, much appreciated!

While I still cannot decode the video, I have now my own
solution.

Here is the Python3 code:

import qrcode
import os
import argparse
import shutil
from pyzbar.pyzbar import decode
from PIL import Image
import base64

parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', help='File to convert to/from QR codes')
parser.add_argument('-e', '--encode', help='Directory to save QR codes', default=None)
parser.add_argument('-d', '--decode', help='Directory to load QR codes from', default=None)
args = parser.parse_args()

def file_to_qrcodes(file_path, directory):
with open(file_path, 'rb') as f:
counter = 0
while True:
data = f.read(1024) # Read in chunks of 1024 bytes
if not data:
break
encoded_data = base64.b64encode(data)
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
qr.add_data(encoded_data)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img.save(os.path.join(directory, f'qr{counter}.png'))
counter += 1

def qrcodes_to_file(directory, output_file):
files = sorted([f for f in os.listdir(directory) if f.startswith('qr') and f.endswith('.png')],
key=lambda x: int(x[2:-4]))
with open(output_file, 'wb') as f:
for file in files:
decoded_objects = decode(Image.open(os.path.join(directory, file)))
if decoded_objects:
encoded_data = decoded_objects[0].data
data = base64.b64decode(encoded_data)
f.write(data)

if args.file and (args.encode or args.decode):
if args.encode:
if not os.path.exists(args.encode):
os.makedirs(args.encode)
file_to_qrcodes(args.file, args.encode)
if args.decode:
if os.path.exists(args.decode):
qrcodes_to_file(args.decode, args.file)

and two bash scripts, for making a movie and for extracing the frames.

#!/bin/bash
#mm - make move from .png files
FOLDERNAME="$1"

cat $(find $FOLDERNAME -maxdepth 1 -name "*.png" | sort -V) | ffmpeg -framerate 25 -i - output.mp4

#!/bin/bash
#ef - extracts QR-Codes from an .mp4 file in a folder

FOLDERFILENAME="$1"
DIRNAME=$(dirname "$FOLDERFILENAME")
BASENAME=$(basename "$FOLDERFILENAME" .mp4)

ffmpeg -i "$FOLDERFILENAME" -start_number 0 "$DIRNAME/qr%d.png"

--
Regards
Stefan

Subject: Re: az - Telefax/OCR Test
From: Stefan Claas
Newsgroups: sci.crypt
Organization: i2pn2 (i2pn.org)
Date: Sat, 4 May 2024 13:09 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: az - Telefax/OCR Test
Date: Sat, 4 May 2024 15:09:12 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <v15c1p$1oa1$1@i2pn2.org>
References: <uoekm1$3rhsc$1@i2pn2.org>
<g74JN.751237$mUo.609280@fx08.ams4>
<v0dtc5$276id$1@i2pn2.org>
<v0dup1$276id$2@i2pn2.org>
<7P6XN.610386$oD2.194358@fx11.ams4>
<v0j5oi$2ddq4$1@i2pn2.org>
<oknXN.41708$XrN3.19814@fx01.ams4>
<v0l0e2$2ff66$1@i2pn2.org>
<v0l9lf$10knh$1@dont-email.me>
<v0lc45$2ft6v$1@i2pn2.org>
<v0lgs1$125o7$1@dont-email.me>
<v0lo29$2gbvu$1@i2pn2.org>
<v0om6r$2juq5$1@i2pn2.org>
<v0r02u$2mfpi$1@i2pn2.org>
<v0rgfd$2l2q1$1@dont-email.me>
<v0suh6$2opr6$1@i2pn2.org>
<v0t2ei$33aat$1@dont-email.me>
<v0t3a4$2ovc1$1@i2pn2.org>
<v106ta$2sj59$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 4 May 2024 13:09:13 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="57665"; mail-complaints-to="usenet@i2pn2.org";
posting-account="uWi4uQdALkj7ETOfPbhNXfz0+Ra/gM5z6/Fa40dJi9U";
Finger: tilde.club/~pollux/
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

Stefan Claas wrote:

> While I still cannot decode the video, I have now my own
> solution.
>
> Here is the Python3 code:
>
> import qrcode
> import os
> import argparse
> import shutil
> from pyzbar.pyzbar import decode
> from PIL import Image
> import base64
>
> parser = argparse.ArgumentParser()
> parser.add_argument('-f', '--file', help='File to convert to/from QR codes')
> parser.add_argument('-e', '--encode', help='Directory to save QR codes', default=None)
> parser.add_argument('-d', '--decode', help='Directory to load QR codes from', default=None)
> args = parser.parse_args()
>
> def file_to_qrcodes(file_path, directory):
> with open(file_path, 'rb') as f:
> counter = 0

Set counter to 1 for my following bash script[1].

> ffmpeg -i "$FOLDERFILENAME" -start_number 0 "$DIRNAME/qr%d.png"

and remove -start_number 0

[1] <https://github.com/stefanclaas/QR-Code-Helpers/blob/main/qr2page.sh>

which allows you to print QR-Codes, nicely formatted, on paper, like
Herbert has shown in his example.

--
Regards
Stefan

Subject: Re: az - Telefax/OCR Test
From: Stefan Claas
Newsgroups: sci.crypt
Organization: i2pn2 (i2pn.org)
Date: Sat, 4 May 2024 17:39 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: az - Telefax/OCR Test
Date: Sat, 4 May 2024 19:39:49 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <v15rt6$2cnd$1@i2pn2.org>
References: <uoekm1$3rhsc$1@i2pn2.org>
<g74JN.751237$mUo.609280@fx08.ams4>
<v0dtc5$276id$1@i2pn2.org>
<v0dup1$276id$2@i2pn2.org>
<7P6XN.610386$oD2.194358@fx11.ams4>
<v0j5oi$2ddq4$1@i2pn2.org>
<oknXN.41708$XrN3.19814@fx01.ams4>
<v0l0e2$2ff66$1@i2pn2.org>
<v0l9lf$10knh$1@dont-email.me>
<v0lc45$2ft6v$1@i2pn2.org>
<v0lgs1$125o7$1@dont-email.me>
<v0lo29$2gbvu$1@i2pn2.org>
<v0om6r$2juq5$1@i2pn2.org>
<v0r02u$2mfpi$1@i2pn2.org>
<v0rgfd$2l2q1$1@dont-email.me>
<v0suh6$2opr6$1@i2pn2.org>
<v0t2ei$33aat$1@dont-email.me>
<v0t3a4$2ovc1$1@i2pn2.org>
<v106ta$2sj59$1@i2pn2.org>
<v15c1p$1oa1$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 4 May 2024 17:39:50 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="78573"; mail-complaints-to="usenet@i2pn2.org";
posting-account="uWi4uQdALkj7ETOfPbhNXfz0+Ra/gM5z6/Fa40dJi9U";
X-Spam-Checker-Version: SpamAssassin 4.0.0
Finger: tilde.club/~pollux/
View all headers

Stefan Claas wrote:

> Stefan Claas wrote:
>
> > While I still cannot decode the video, I have now my own
> > solution.
> >
> > Here is the Python3 code:
> >
> > import qrcode
> > import os
> > import argparse
> > import shutil
> > from pyzbar.pyzbar import decode
> > from PIL import Image
> > import base64
> >
> > parser = argparse.ArgumentParser()
> > parser.add_argument('-f', '--file', help='File to convert to/from QR codes')
> > parser.add_argument('-e', '--encode', help='Directory to save QR codes', default=None)
> > parser.add_argument('-d', '--decode', help='Directory to load QR codes from', default=None)
> > args = parser.parse_args()
> >
> > def file_to_qrcodes(file_path, directory):
> > with open(file_path, 'rb') as f:
> > counter = 0
>
> Set counter to 1 for my following bash script[1].
>
> > ffmpeg -i "$FOLDERFILENAME" -start_number 0 "$DIRNAME/qr%d.png"
>
> and remove -start_number 0
>
> [1] <https://github.com/stefanclaas/QR-Code-Helpers/blob/main/qr2page.sh>
>
> which allows you to print QR-Codes, nicely formatted, on paper, like
> Herbert has shown in his example.
>
I have updated my pad program with an additional bash script so that
users can pad there files, prior converting. That way the last frame
or QR-Code in a document has the same size as the others. Padding can
later been removed, with my pad program, from the file.

https://github.com/stefanclaas/pad

--
Regards
Stefan

Pages:12

rocksolid light 0.9.8
clearnet tor