For file format QR code.
See original GitHub issueI made a simple wrapper to handle the file format QR code:
def _decode(self, filename):
try:
# the origin code
cmd = ' '.join([self.command, self.lib_path, 'file:///' + filename, '--multi'])
(stdout, _) = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
universal_newlines=True,
shell=True).communicate()
lines = stdout.splitlines()
separator_idx = [
i for i in range(len(lines)) if lines[i][:4] == 'file'
] + [len(lines)]
result = [
self._parse_single(lines[separator_idx[i]:separator_idx[i + 1]])
for i in range(len(separator_idx) - 1)
]
except:
# my add-in code
cmd = ' '.join([self.command, self.lib_path, 'file:///' + filename, '--multi'])
(lines, _) = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
result = lines[lines.index(b'Raw result:\n')+len(b'Raw result:\n'):lines.index(b'\nFound')]
return result
This will return the ‘Raw result’ bytes while the result can’t be decoded with the default character set.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
QR Code File Formats - QR4 - QRCode
QR codes can be created and saved in various bitmap and vector formats. Which type is best for your QR codes? When is...
Read more >File QR code converter: Create QR codes for your files
File to QR code: Ultimate guide on how to use a file QR code converter to convert your files into a QR code...
Read more >QR code - Wikipedia
A QR code is a type of matrix barcode (or two-dimensional barcode) invented in 1994 by the Japanese company Denso Wave. A barcode...
Read more >print-ready Vector Format | qrd°by - EPS QR Code Generator
QR means "quick response" and QR Codes allow users quick and easy access to web pages, PDF files, videos, forms or other information....
Read more >What's the best format for QR Code file (SVG, JPG, TIFF, PNG)?
Conclusion: JPEG is not only uglier, but also much larger than the other formats. GIF good, but PNG is the smallest and has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I change everything into bytes. Please check the latest version.
thank you for update!