Hi everybody,
I was trying to load and display a big image with a resolution over
20000x20000 and got an AttributeError for the imageToArray function.
After reducing the resolution it was working without any error, so I
divided the image into multiple small images.
With the following code i still get the AttributeError shown below.
The error does not always occur at the same time. It varies between image
14 and 18.
I use pyqtgraph version 0.10.0 and PyQt5 version 5.12.2.
Thanks for your help.
from PyQt5 import QtGui
import pyqtgraph as pg
n = 1
while n <= 25:
print(n)
imgfile = str(n)
img = QtGui.QImage(imgfile)
img = img.convertToFormat(QtGui.QImage.Format_ARGB32_Premultiplied)
imgArray = pg.imageToArray(img, copy=True)
if n == 1:
imgArrays = [imgArray]
else:
imgArrays.append(imgArray)
n += 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Traceback (most recent call last):
File "C:/Users/User/Project/test.py", line 11, in <module>
imgArray = pg.imageToArray(img, copy=True)
File "C:\Program Files
(x86)\Python37-32\lib\site-packages\pyqtgraph\functions.py", line 1177, in
imageToArray
ptr.setsize(img.byteCount())
AttributeError: 'NoneType' object has no attribute 'setsize'
Process finished with exit code 1
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/be1d9ffc-495a-4a87-853c-33c32eab550a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.