Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
hydrargyrum
attic
Commits
2c33fcdb
Commit
2c33fcdb
authored
Nov 06, 2019
by
hydrargyrum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qr-shot: import PIL correctly
parent
44d9033b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
qr-shot/qrshot.py
qr-shot/qrshot.py
+4
-4
No files found.
qr-shot/qrshot.py
View file @
2c33fcdb
...
...
@@ -38,8 +38,8 @@ def decodeImage(qpix):
temp
=
tempfile
.
NamedTemporaryFile
(
suffix
=
'.png'
)
qpix
.
save
(
temp
.
name
)
import
Image
pilimage
=
Image
.
open
(
temp
.
name
)
import
PIL.
Image
pilimage
=
PIL
.
Image
.
open
(
temp
.
name
)
pilimage
=
pilimage
.
convert
(
'L'
)
rawbytes
=
''
.
join
(
map
(
chr
,
pilimage
.
getdata
()))
...
...
@@ -194,11 +194,11 @@ class Window(QMainWindow):
self
.
loadAction
=
menu
.
addAction
(
'Load image...'
)
self
.
saveAction
=
menu
.
addAction
(
'Save image...'
)
menu
.
addAction
(
'Quit'
).
triggered
.
connect
(
QApplication
.
instance
().
quit
)
menu
=
self
.
menuBar
().
addMenu
(
'Data'
)
self
.
decodeAction
=
menu
.
addAction
(
'Decode image'
)
self
.
encodeAction
=
menu
.
addAction
(
'Encode text...'
)
menu
=
self
.
menuBar
().
addMenu
(
'Screenshot'
)
self
.
shootAction
=
menu
.
addAction
(
'Take screenshot'
)
self
.
cropAction
=
menu
.
addAction
(
'Crop'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment