File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 29
29
WindowTemplate , TemplateBaseClass = pg .Qt .loadUiType (uiFile )
30
30
31
31
def updateDelay (scale , time ):
32
+ """ Hack fix for scalebar inaccuracy """
32
33
QtCore .QTimer .singleShot (time , scale .updateBar )
33
34
34
35
class MainWindow (TemplateBaseClass ):
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def load_image(self):
62
62
try :
63
63
file = QtWidgets .QFileDialog .getOpenFileName (self , 'Open file' , os .getcwd ())
64
64
self .original_image = Image .open (file [0 ])
65
- self .original_image = self .original_image .rotate (- 90 , expand = True )
65
+ self .original_image = self .original_image .rotate (- 90 , expand = True ) #correct image orientation
66
66
self .resize_to_scaling_factor (self .original_image )
67
67
except Exception as err :
68
68
print (format (err ))
@@ -76,7 +76,7 @@ def resize_to_scaling_factor(self, image):
76
76
image = image .resize ((round (image .size [0 ]* self .scaling_factor ), round (image .size [1 ]* self .scaling_factor )))
77
77
if self .ui .greyscale_checkBox .isChecked ():
78
78
image = image .convert ("L" ) #convert to greyscale
79
- image_array = np .array (image ) #correct numpy array auto-flip
79
+ image_array = np .array (image )
80
80
81
81
width = image_array .shape [0 ]
82
82
height = image_array .shape [1 ]
You can’t perform that action at this time.
0 commit comments