MCPcopy Create free account
hub / github.com/ashutosh1807/PixelFormer / loadImageFile

Method loadImageFile

pixelformer/demo.py:214–225  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212 self.updateCloud()
213
214 def loadImageFile(self):
215 print('== loadImageFile')
216 self.capture = None
217 filename = \
218 QtWidgets.QFileDialog.getOpenFileName(None, 'Select image', '', self.tr('Image files (*.jpg *.png)'))[0]
219 img = QtGui.QImage(filename).scaledToHeight(height_rgb)
220 xstart = 0
221 if img.width() > width_rgb: xstart = (img.width() - width_rgb) // 2
222 img = img.copy(xstart, 0, xstart + width_rgb, height_rgb)
223 self.inputViewer.setPixmap(QtGui.QPixmap.fromImage(img))
224 print('== loadImageFile')
225 self.updateCloud()
226
227 def update_input(self):
228 print('== update_input')

Callers

nothing calls this directly

Calls 1

updateCloudMethod · 0.95

Tested by

no test coverage detected