Bug in ImageExporter.py

20 views
Skip to first unread message

Lior Weintraub

unread,
Sep 12, 2018, 1:41:46 PM9/12/18
to pyqtgraph
Hi,

I am using python 3.6 on Windows and running pyqtgraph version 0.10.0.
When using image exporter according this example I got exception on ImageExplorer.py line 70:

        bg = np.empty((self.params['width'], self.params['height'], 4), dtype=np.ubyte)

Note that only the concept was copied from the example and was applied on my plot which had different distentions.
The exception was caused because height was a float number.
I saw in code that aspect ratio is kept so I change the width dimension so the height would be an integer.
Even then, the height was set to float.
In my example the width was 3000 and the height was calculated as 1750.0
Finally, when nothing worked I patched the code and changed line 70 to:

        bg = np.empty((int(self.params['width']), int(self.params['height']), 4), dtype=np.ubyte)

If you think this needs to be fixed in a differently, please share your thoughts.

Best regards,
Lior.
  

Patrick

unread,
Sep 12, 2018, 11:39:18 PM9/12/18
to pyqtgraph
Yes, that is an issue with the 0.10 release. It's fixed if you get the latest version from the git repository.

Lior Weintraub

unread,
Sep 13, 2018, 1:48:43 AM9/13/18
to pyqt...@googlegroups.com
Thanks.

--
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 pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/8a738845-3049-40e4-adb4-ca4429abe6ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages