Commit 92aa094d by devttys0

Fixed pyqtgraph 0.9.10 ImageExport compatibility bug.

parent 01bee124
...@@ -293,7 +293,11 @@ class Entropy(Module): ...@@ -293,7 +293,11 @@ class Entropy(Module):
# TODO: legend is not displayed properly when saving plots to disk # TODO: legend is not displayed properly when saving plots to disk
if self.save_plot: if self.save_plot:
exporter = exporters.ImageExporter.ImageExporter(plt.plotItem) # exporters.ImageExporter is different in different versions of pyqtgraph
try:
exporter = exporters.ImageExporter(plt.plotItem)
except TypeError:
exporter = exporters.ImageExporter.ImageExporter(plt.plotItem)
exporter.parameters()['width'] = self.FILE_WIDTH exporter.parameters()['width'] = self.FILE_WIDTH
exporter.export(binwalk.core.common.unique_file_name(fname, self.FILE_FORMAT)) exporter.export(binwalk.core.common.unique_file_name(fname, self.FILE_FORMAT))
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment