Skip to content
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

non-zero exit status 4 #5

Open
toldenburger opened this issue Dec 2, 2017 · 5 comments
Open

non-zero exit status 4 #5

toldenburger opened this issue Dec 2, 2017 · 5 comments

Comments

@toldenburger
Copy link

I'm getting a non-zero exit status 4 error.

Probably due to my incompetence.
I'm trying to import 2 png's that I just made with the export tool.

gpg2paper.py import --pubkey mykey.asc --png --in tryout1.png tryout2.png

after which I get:

`scanned 0 barcode symbols from 1 images in 1 seconds

WARNING: barcode data was not detected in some image(s)
things to check:
- is the barcode type supported? currently supported symbologies are:
EAN/UPC (EAN-13, EAN-8, UPC-A, UPC-E, ISBN-10, ISBN-13),
Code 128, Code 39 and Interleaved 2 of 5
- is the barcode large enough in the image?
- is the barcode mostly in focus?
- is there sufficient contrast/illumination?

Traceback (most recent call last):
File "/usr/local/bin/gpg2paper.py", line 274, in
sys.exit(main())
File "/usr/local/bin/gpg2paper.py", line 109, in main
do_import(args)
File "/usr/local/bin/gpg2paper.py", line 122, in do_import
base64str = read_chunks_png(args.in_filenames)
File "/usr/local/bin/gpg2paper.py", line 151, in read_chunks_png
chunk = subprocess.check_output(['zbarimg', '--raw', in_filename])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
`

Any ideas about what I'm doing wrong?
And thanks for making this tool!

@balos1
Copy link
Owner

balos1 commented Dec 3, 2017

Can you post the command you used when you did the export?

-- Edit --
I was able to replicate the error after realizing you had split the key into 2 qrcodes. I believe the error must be because splitting 2 ways results in chunks which are too big. There might not be a way around this if we are hitting the maximum amount of data for the largest QRCode size (version 40). I will explore the issue more, but in the meantime, split your key into 4 or more qrcodes.

@toldenburger
Copy link
Author

Thank you for the reply. I tried splitting in 4 QR codes and then importing. Same result.
Here is the command I use for exporting:

gpg2paper.py export -k 37D7E467 -n 4 -png --out name

It must be a silly mistake at my end. Thank you for helping.

@balos1
Copy link
Owner

balos1 commented Dec 20, 2017

Sorry, it has taken so long for me to reply. What size is the key you are using (1024, 2048, 4096 etc)? Can you post the command you used to create your gpg key (don't post any of the output from the command or any other sensitive information)?

@welteki
Copy link

welteki commented Dec 30, 2017

I encountered the same error. zbar is not recognizing the images. But as mentioned in the original gist this project was inspired on, it says to try downscaling the images when this happens. After i did this the script exited without errors.

@balos1
Copy link
Owner

balos1 commented Dec 31, 2017

@welteki Yeah, my suspicion is that the keys are 4096 bits, or the images just need to be downsampled as you pointed out. I tried splitting a 4096 bit key into 4 QR codes, and then tried importing them and I get the error from zbar. Splitting the 4096 bit key into 8 QR codes seems to work though.

From the standpoint of easy-gpg-to-paper I think that a minimum number of qrcodes to split the key into can be required based on the size of a key. However, if a qrcode is scanned in and then passed to easy-gpg-to-paper, the best thing that can be done is to provide a better error explaining that the image may need to be downsampled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants