예제 #1
0
 def on_pushButton_6_clicked(self):
     """
    ‘水印解析’  按钮点击事件响应函数
     """
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择PNG文件', '../../../../DemoImage/Output', 'PNG文件(*.png)')
     imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                           self.label.height())
     Ui_MainWindow.show(self, imgs)
     img = Image.open(filename)
     img_wave = self.BWM.new_read(img)
     QMessageBox.information(self, "Success", "解析成功")
     Ui_MainWindow.show(self, img_wave)
예제 #2
0
 def on_JsteG_pushButton_clicked(self):
     """
     ‘JsteG隐写’按钮点击事件响应函数
     """
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择JPG文件', '../../../../DemoImage/Input', 'JPG文件(*.jpg)')
     imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                           self.label.height())
     Ui_MainWindow.show(self, imgs)
     text, okPressed = QInputDialog.getText(self, "JsteG", "Input Data:",
                                            QLineEdit.Normal, "")
     filename1, _ = QFileDialog.getSaveFileName(
         self, '请选择保存路径', '../../../../DemoImage/Output', 'JPG文件(*.jpg)')
     write_new(filename, filename1, text)
     QMessageBox.information(self, "Success", "写入成功")
예제 #3
0
 def on_pushButton_9_clicked(self):
     """
    ‘文件隐藏解析’  按钮点击事件响应函数
     """
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择PNG文件', '../../../../DemoImage/Output', 'PNG文件(*.png)')
     img = Image.open(filename)
     imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                           self.label.height())
     Ui_MainWindow.show(self, imgs)
     QMessageBox.information(self, "decode", "点击开始解析")
     decodeimg = self.attachFile.read(img).scaled(self.label.width(),
                                                  self.label.height())
     Ui_MainWindow.show(self, decodeimg)
     QMessageBox.information(self, "Success", "检测成功")
예제 #4
0
 def on_LSB_pushButton_clicked(self):
     """
     ‘LSB隐写’按钮点击事件响应函数
     """
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择BMP文件', '../../../../DemoImage/Input', 'BMP文件(*.bmp)')
     imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                           self.label.height())
     Ui_MainWindow.show(self, imgs)
     text, okPressed = QInputDialog.getText(self, "LSB", "Input Data:",
                                            QLineEdit.Normal, "")
     QMessageBox.information(self, "LSB写入内容", text)
     filename1, _ = QFileDialog.getSaveFileName(
         self, '请选择保存路径', '../../../../DemoImage/Output', 'BMP文件(*.bmp)')
     self.LSB.new_write(filename, filename1, text)
     QMessageBox.information(self, "Success", "写入成功")
예제 #5
0
    def on_Ezsetgo_pushButton_clicked(self):
        """
        EzSteg 按钮响应函数
        """

        filename, _ = QFileDialog.getOpenFileName(
            self, '请选择文件', '../../../../DemoImage/Input', '图片文件(*.png)')
        imgs = QtGui.QPixmap(filename).scaled(
            self.label.width(),
            self.label.height())  #show images in suitable scales
        Ui_MainWindow.show(self, imgs)
        text, okPressed = QInputDialog.getText(self, "Get text", "Input Data:",
                                               QLineEdit.Normal, "")
        #print("text is ",text)
        QMessageBox.information(self, "EzSteg写入内容", text)
        new_img = self.EzSteg.new_write(filename, text)
        filename, _ = QFileDialog.getSaveFileName(
            self, '请选择保存路径', '../../../../DemoImage/Output', '图片文件(*.png)')
        new_img.save(filename)
        QMessageBox.information(self, "Success", "写入成功")
예제 #6
0
    def on_imgfile_pushButton_clicked(self):
        """
        文件隐藏  按钮响应函数
        """

        filename, _ = QFileDialog.getOpenFileName(
            self, '请选择PNG文件', '../../../../DemoImage/Input', 'PNG文件(*.png)')
        img = Image.open(filename)
        imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                              self.label.height())
        Ui_MainWindow.show(self, imgs)

        QMessageBox.information(self, "Open file", "请打开需要写入的文件")
        filename1, _ = QFileDialog.getOpenFileName(
            self, '请选择文件', '../../../../DemoImage/Input', 'Dat文件(*.dat)')
        #text = np.loadtxt(filename1, dtype=bytes).astype(str).tolist()
        text = open(filename1).read()
        #print(text)
        attachimg = self.attachFile.write(img, text)
        filename2, _ = QFileDialog.getSaveFileName(
            self, '选择保存的路径', '../../../../DemoImage/Output', 'PNG文件(*.png)')
        attachimg.save(filename2, 'PNG')
        QMessageBox.information(self, "Success", "保存成功")
예제 #7
0
 def on_watermark_pushButton_clicked(self):
     """
     watermark 按钮响应函数
     """
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择PNG文件', '../../../../DemoImage/Input', 'PNG文件(*.png)')
     imgs = QtGui.QPixmap(filename).scaled(self.label.width(),
                                           self.label.height())
     Ui_MainWindow.show(self, imgs)
     #write
     img = Image.open(filename)
     #self.BWM.load_img(filename)
     QMessageBox.information(self, "watermark", "请选择水印图片")
     filename, _ = QFileDialog.getOpenFileName(
         self, '请选择水印文件', '../../../../DemoImage/Input', 'PNG文件(*.png)')
     #self.BWM.load_wm(filename)
     mark = Image.open(filename)
     newimg = self.BWM.new_write(img, mark)
     #imgs = self.BWM.write()
     filename, _ = QFileDialog.getSaveFileName(
         self, '请选择保存路径', '../../../../DemoImage/Output', 'PNG文件(*.png)')
     newimg.save(filename)
     #cv2.imwrite(filename, imgs)
     QMessageBox.information(self, "Success", "水印写入成功")