Skip to content

Commit 1fcabc8

Browse files
committed
Disable Java GUI components
Adding `-Djava.awt.headless=true` apparently prevents the annoying, laggy GUI popups when launched ZXing CLR on MacOS or Windows. Found at https://stackoverflow.com/a/60828709/20789
1 parent 69497a7 commit 1fcabc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zxing/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def decode(self, filenames, try_harder=False, possible_formats=None, pure_barcod
112112
fn = fn_or_im
113113
file_uris.append(pathlib.Path(fn).absolute().as_uri())
114114

115-
cmd = [self.java, '-cp', self.classpath, self.cls] + file_uris
115+
cmd = [self.java, '-Djava.awt.headless=true', '-cp', self.classpath, self.cls] + file_uris
116116
if self.zxing_version_info and self.zxing_version_info >= (3, 5, 3):
117117
# The --raw option was added in 3.5.0, but broken for certain barcode types (PDF_417 and maybe others) until 3.5.3
118118
# See https://github.com/zxing/zxing/issues/1682 and https://github.com/zxing/zxing/issues/1683

0 commit comments

Comments
 (0)