diff --git a/CHANGELOG.md b/CHANGELOG.md index 85596cef..2d5a2f7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ CHANGELOG for FlatCAM beta - in Geometry object the default self.options dictionary is updated with keys that reflect new data structure - added comments in the `default` preprocessors which will help other people create their own preprocessors - remade the Image Import plugin in an attempt to fix issues with the latest packages of Gdal and Rasterio but it looks that it is a conflict between the Rasterio 1.2.10, Gdal 3.4.1 and Shapely 1.8.0 - +- made a hack so if the Image Import plugin can't be loaded due of dependencies errors the app will not crash but this plugin will no longer be available 18.01.2022 diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index 3059db95..d92cc40f 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -4,10 +4,8 @@ # Date: 3/10/2019 # # MIT Licence # # ########################################################## -import sys - from PyQt6 import QtGui, QtWidgets -import os +import os, sys from shapely.geometry import shape from shapely.ops import unary_union @@ -15,7 +13,7 @@ from shapely.affinity import scale, translate import numpy as np -# import rasterio +import rasterio from rasterio import open as rasterio_open from rasterio.features import shapes diff --git a/appPlugins/__init__.py b/appPlugins/__init__.py index 2986064a..98bce482 100644 --- a/appPlugins/__init__.py +++ b/appPlugins/__init__.py @@ -7,7 +7,10 @@ from appPlugins.ToolAlignObjects import AlignObjects from appPlugins.ToolFilm import Film -from appPlugins.ToolImage import ToolImage +try: + from appPlugins.ToolImage import ToolImage +except ImportError: + pass from appPlugins.ToolDistance import Distance from appPlugins.ToolObjectDistance import ObjectDistance diff --git a/app_Main.py b/app_Main.py index f51edcb6..5a587f90 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1998,10 +1998,13 @@ class App(QtCore.QObject): pos=self.ui.menufileimport, separator=True) - self.image_tool = ToolImage(self) - self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'), - pos=self.ui.menufileimport, - separator=True) + try: + self.image_tool = ToolImage(self) + self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'), + pos=self.ui.menufileimport, + separator=True) + except Exception: + self.image_tool = lambda x: None self.pcb_wizard_tool = PcbWizard(self) self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'),