10 Commits

Author SHA1 Message Date
875e31a39a Rebase this commit to abort Chinese translation. 2025-04-18 17:00:23 +08:00
df376249f0 [1.5] Merge https://github.com/souno-io/Stegsolve 2025-04-18 14:48:31 +08:00
63ffafb7b8 [1.4, 1.5-alpha1] Merge https://github.com/Giotino/stegsolve 2025-04-18 14:36:46 +08:00
8704aff67e [1.3] Original version
Source code inside http://www.caesum.com/handbook/Stegsolve.jar, by Caesum, 2011-05-19
2025-04-18 14:03:43 +08:00
SOUNO
b43da72604 Update README.md 2023-06-21 11:06:03 +08:00
SOUNO
ca8d2fd8e6 Update README.md 2023-06-21 11:02:55 +08:00
souno
2d12e5ad91 1.5修复版本 2023-06-15 13:54:31 +08:00
souno
f1d67bf8c7 1.5修复版本 2023-06-15 13:49:47 +08:00
souno
f7366f0fee 1.5修复版本 2023-06-15 13:25:45 +08:00
souno
8b2e038551 1.5修复版本 2023-06-15 13:21:35 +08:00
15 changed files with 108 additions and 200 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -1,5 +1,5 @@
<component name="ArtifactManager">
<artifact type="jar" name="StegSolve">
<artifact type="jar" build-on-make="true" name="StegSolve">
<output-path>$PROJECT_DIR$/out/artifacts/StegSolve</output-path>
<root id="archive" name="StegSolve.jar">
<element id="directory" name="META-INF">

9
.idea/artifacts/stegsolve_jar.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="ArtifactManager">
<artifact type="jar" name="stegsolve:jar">
<output-path>$PROJECT_DIR$/out/artifacts/stegsolve_jar</output-path>
<root id="archive" name="stegsolve.jar">
<element id="module-output" name="stegsolve" />
<element id="extracted-dir" path="$USER_HOME$/Desktop/flatlaf-3.1.1.jar" path-in-jar="/" />
</root>
</artifact>
</component>

4
.idea/misc.xml generated
View File

@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectPlainTextFileTypeManager">
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="jbrsdk_jcef-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

127
.idea/uiDesigner.xml generated
View File

@@ -1,127 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
<component name="uidesigner-configuration">
<option name="DEFAULT_LAYOUT_MANAGER" value="FlowLayout" />
</component>
</project>

1
.idea/vcs.xml generated
View File

@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -1,6 +1,13 @@
# StegSolve
A modifed version of stegsolve
StegSolve的升级修复版本!
![](./img.png)
## 1.5 changes
- 汉化部分内容
- 美化界面为Jetbrians风格
- 修复原来1.4版本的帧浏览器、合并图片等功能的不显示图片bug。
## 1.4 changes
@@ -8,4 +15,9 @@ A modifed version of stegsolve
- Added zoom to image
- Added drag&drop zone for files
- Added "all" option to channel planes in "Data Extract"
- Added horizontal scrolling (Shift+Mousewheel)
- Added horizontal scrolling (Shift+Mousewheel)
# Special Thanks
Special thanks to [JetBrains](https://www.jetbrains.com) for their support to this project.
[![](https://raw.githubusercontent.com/ffffffff0x/BerylEnigma/master/assets/img/JetBrains.png)](https://www.jetbrains.com)

BIN
flatlaf-3.1.1.jar Normal file

Binary file not shown.

BIN
img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -7,5 +7,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="flatlaf-3.1.11" level="project" />
</component>
</module>

View File

@@ -43,7 +43,7 @@ public class AboutFrame extends javax.swing.JFrame {
jEditorPane1.setContentType("text/html");
jEditorPane1.setEditable(false);
jEditorPane1.setText("<html>\n<center><b>Stegsolve v1.4 by Caesum<br>Mod by Giotino</b></center>\n<br>\nStegsolve is a stegano solver for challenges. It provides these main functions:\n<ul>\n<li>A quick view of different bit planes and some simple transformations.</li>\n<li>Data extraction from planes. This can be row order or column order, with bits treated as a bitstream and converted into bytes.</li>\n<li>Some simple checking of file formats and reporting on the filesize, additional bytes, file holes, etc. This is highly dependent upon the type of image.</li>\n<li>Stereogram solver - simply change the offset until the image becomes visible.</li>\n<li>Frame browser for animated images. This should also work for viewing layers in multi-layered PNG files.</li>\n<li>Image combiner to combine two images in a variety of ways and browse through the different combinations.</li>\n</ul>\n<p>Copy/Cut and paste is available from most text using CTRL-C to copy, CTRL-V to paste and CTRL-X for cut.\n<p>If an image fails to load, for example because it is corrupt, then file analysis will still open the file that you just tried to view. It may, however, crash out before reporting the information that you want to know. This will work though on images where the PNG has corrupted CRC values for example.\n</html>\n");
jEditorPane1.setText("<html>\n<center><b>Stegsolve v1.5 by Souno Inherited in Caesum<br>Mod by Giotino</b></center>\n<br>\nStegsolve is a stegano solver for challenges. It provides these main functions:\n<ul>\n<li>A quick view of different bit planes and some simple transformations.</li>\n<li>Data extraction from planes. This can be row order or column order, with bits treated as a bitstream and converted into bytes.</li>\n<li>Some simple checking of file formats and reporting on the filesize, additional bytes, file holes, etc. This is highly dependent upon the type of image.</li>\n<li>Stereogram solver - simply change the offset until the image becomes visible.</li>\n<li>Frame browser for animated images. This should also work for viewing layers in multi-layered PNG files.</li>\n<li>Image combiner to combine two images in a variety of ways and browse through the different combinations.</li>\n</ul>\n<p>Copy/Cut and paste is available from most text using CTRL-C to copy, CTRL-V to paste and CTRL-X for cut.\n<p>If an image fails to load, for example because it is corrupt, then file analysis will still open the file that you just tried to view. It may, however, crash out before reporting the information that you want to know. This will work though on images where the PNG has corrupted CRC values for example.\n</html>\n");
jEditorPane1.setMinimumSize(new java.awt.Dimension(150, 150));
jEditorPane1.setPreferredSize(new java.awt.Dimension(150, 150));
jScrollPane1.setViewportView(jEditorPane1);

View File

@@ -222,8 +222,10 @@ public class Combiner extends JFrame
dp.setPreferredSize(new Dimension(transform.getImage().getWidth(),transform.getImage().getHeight()));
this.setMaximumSize(getToolkit().getScreenSize());
pack();
dp.apply(100);
scrollPane.revalidate();
repaint();
this.setSize(500, 600);
}
}

View File

@@ -253,8 +253,10 @@ public class FrameBrowser extends JFrame
dp.setPreferredSize(new Dimension(bi.getWidth(),bi.getHeight()));
this.setMaximumSize(getToolkit().getScreenSize());
pack();
dp.apply(100);
scrollPane.revalidate();
repaint();
this.setSize(500, 600);
}
}

View File

@@ -6,6 +6,8 @@
package stegsolve;
import com.formdev.flatlaf.FlatIntelliJLaf;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
@@ -22,10 +24,10 @@ import java.awt.*;
/**
* StegSolve
*
* @author Caesum
*/
public class StegSolve extends JFrame
{
public class StegSolve extends JFrame {
static StegSolve that;
/**
* Menu option - about
@@ -118,16 +120,17 @@ public class StegSolve extends JFrame
*/
private Transform transform = null;
/** Creates new form stegsolve */
private StegSolve()
{
/**
* Creates new form stegsolve
*/
private StegSolve() {
that = this;
initComponents();
}
// <editor-fold defaultstate="collapsed" desc="Initcomponents()">
private void initComponents() {
FlatIntelliJLaf.install();
menuBar = new JMenuBar();
menuFile = new JMenu();
fileOpen = new JMenuItem();
@@ -234,44 +237,46 @@ public class StegSolve extends JFrame
frame.addKeyListener(new KeyListener() {
@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
if(e.isShiftDown()) {
frame.addMouseWheelListener(arg01 -> {
// TODO Auto-generated method stub
scrollPane.getHorizontalScrollBar().setValue(scrollPane.getHorizontalScrollBar().getValue()+ arg01.getWheelRotation());
});
// TODO Auto-generated method stub
if (e.isShiftDown()) {
frame.addMouseWheelListener(arg01 -> {
// TODO Auto-generated method stub
scrollPane.getHorizontalScrollBar().setValue(scrollPane.getHorizontalScrollBar().getValue() + arg01.getWheelRotation());
});
}
}
@Override
public void keyReleased(KeyEvent e) {
if(!e.isShiftDown()) {
if (!e.isShiftDown()) {
frame.removeMouseWheelListener(frame.getMouseWheelListeners()[0]);
}
}
@Override
public void keyTyped(KeyEvent e) {}
public void keyTyped(KeyEvent e) {
}
});
add(scrollPane, BorderLayout.CENTER);
backwardButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,0), "back");
backwardButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), "back");
backwardButton.getActionMap().put("back", backButtonPress);
forwardButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,0), "forward");
forwardButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), "forward");
forwardButton.getActionMap().put("forward", forwardButtonPress);
this.setTitle("StegSolve 1.4 by Caesum (Mod by Giotino)");
this.setTitle("StegSolve 1.5 by Souno (龙腾四季专版)");
this.setMaximumSize(getToolkit().getScreenSize());
pack();
this.setSize(500, 600);
this.setSize(800, 600);
//setResizable(false);
}// </editor-fold>
/**
* Close the form on file exit
*
* @param evt Event
*/
private void fileExitActionPerformed(ActionEvent evt) {
@@ -281,18 +286,19 @@ public class StegSolve extends JFrame
/**
* This is used to map the left arrow key to the back button
*/
private Action backButtonPress = new AbstractAction()
{
public void actionPerformed(ActionEvent e)
{ backwardButtonActionPerformed(e);}
private Action backButtonPress = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
backwardButtonActionPerformed(e);
}
};
/**
* Move back by one image
*
* @param evt Event
*/
private void backwardButtonActionPerformed(ActionEvent evt) {
if(transform == null) return;
if (transform == null) return;
transform.back();
updateImage();
}
@@ -300,24 +306,26 @@ public class StegSolve extends JFrame
/**
* This is used to map the right arrow key to the forward button
*/
private Action forwardButtonPress = new AbstractAction()
{
public void actionPerformed(ActionEvent e)
{ forwardButtonActionPerformed(e);}
private Action forwardButtonPress = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
forwardButtonActionPerformed(e);
}
};
/**
* Move forward by one image
*
* @param evt Event
*/
private void forwardButtonActionPerformed(ActionEvent evt) {
if(bi == null) return;
if (bi == null) return;
transform.forward();
updateImage();
}
/**
* Show the help/about frame
*
* @param evt Event
*/
private void aboutActionPerformed(ActionEvent evt) {
@@ -326,6 +334,7 @@ public class StegSolve extends JFrame
/**
* Open the file format analyser
*
* @param evt Event
*/
private void analyseFormatActionPerformed(ActionEvent evt) {
@@ -334,6 +343,7 @@ public class StegSolve extends JFrame
/**
* Open the stereogram solver
*
* @param evt Event
*/
private void stereoSolveActionPerformed(ActionEvent evt) {
@@ -342,6 +352,7 @@ public class StegSolve extends JFrame
/**
* Open the frame browser
*
* @param evt Event
*/
private void frameBrowseActionPerformed(ActionEvent evt) {
@@ -350,6 +361,7 @@ public class StegSolve extends JFrame
/**
* Open the image combiner
*
* @param evt Event
*/
private void imageCombineActionPerformed(ActionEvent evt) {
@@ -359,24 +371,21 @@ public class StegSolve extends JFrame
fileChooser.setDialogTitle("Select image to combine with");
int rVal = fileChooser.showOpenDialog(this);
System.setProperty("user.dir", fileChooser.getCurrentDirectory().getAbsolutePath());
if(rVal == JFileChooser.APPROVE_OPTION)
{
if (rVal == JFileChooser.APPROVE_OPTION) {
sfile = fileChooser.getSelectedFile();
try
{
try {
BufferedImage bi2 = null;
bi2 = ImageIO.read(sfile);
new Combiner(bi, bi2).setVisible(true);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, "Failed to load file: " +e.toString());
} catch (Exception e) {
JOptionPane.showMessageDialog(this, "Failed to load file: " + e.toString());
}
}
}
/**
* Open the data extractor
*
* @param evt Event
*/
private void analyseExtractActionPerformed(ActionEvent evt) {
@@ -385,35 +394,32 @@ public class StegSolve extends JFrame
/**
* Save the current transformed image
*
* @param evt Event
*/
private void fileSaveActionPerformed(ActionEvent evt)
{
private void fileSaveActionPerformed(ActionEvent evt) {
JFileChooser fileChooser = new JFileChooser(System.getProperty("user.dir"));
fileChooser.setSelectedFile(new File("solved.bmp"));
int rVal = fileChooser.showSaveDialog(this);
System.setProperty("user.dir", fileChooser.getCurrentDirectory().getAbsolutePath());
if(rVal == JFileChooser.APPROVE_OPTION)
{
if (rVal == JFileChooser.APPROVE_OPTION) {
sfile = fileChooser.getSelectedFile();
try
{
try {
bi = transform.getImage();
int rns = sfile.getName().lastIndexOf(".")+1;
if(rns==0)
ImageIO.write(bi, "bmp", sfile);
int rns = sfile.getName().lastIndexOf(".") + 1;
if (rns == 0)
ImageIO.write(bi, "bmp", sfile);
else
ImageIO.write(bi, sfile.getName().substring(rns), sfile);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, "Failed to write file: "+e.toString());
ImageIO.write(bi, sfile.getName().substring(rns), sfile);
} catch (Exception e) {
JOptionPane.showMessageDialog(this, "Failed to write file: " + e.toString());
}
}
}
/**
* Open a file
*
* @param evt Event
*/
private void fileOpenActionPerformed(ActionEvent evt) {
@@ -422,8 +428,7 @@ public class StegSolve extends JFrame
fileChooser.setFileFilter(filter);
int rVal = fileChooser.showOpenDialog(this);
System.setProperty("user.dir", fileChooser.getCurrentDirectory().getAbsolutePath());
if(rVal == JFileChooser.APPROVE_OPTION)
{
if (rVal == JFileChooser.APPROVE_OPTION) {
sfile = fileChooser.getSelectedFile();
loadImage(sfile);
}
@@ -436,28 +441,24 @@ public class StegSolve extends JFrame
void loadImage(File sfile) {
this.sfile = sfile;
try
{
try {
bi = ImageIO.read(sfile);
transform = new Transform(bi);
newImage();
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(this, "Failed to load file: " +e.toString());
JOptionPane.showMessageDialog(this, "Failed to load file: " + e.toString());
}
}
/**
* Reset settings for a new image
*/
private void newImage()
{
private void newImage() {
nowShowing.setText(transform.getText());
dp.setImage(transform.getImage());
dp.setSize(transform.getImage().getWidth(), transform.getImage().getHeight());
dp.setPreferredSize(new Dimension(transform.getImage().getWidth(),transform.getImage().getHeight()));
dp.setPreferredSize(new Dimension(transform.getImage().getWidth(), transform.getImage().getHeight()));
this.setMaximumSize(getToolkit().getScreenSize());
zoomSlider.setValue(100);
dp.apply(100);
@@ -468,16 +469,15 @@ public class StegSolve extends JFrame
/**
* Update the image being shown for new transform
*/
private void updateImage()
{
private void updateImage() {
nowShowing.setText(transform.getText());
dp.setImage(transform.getImage());
repaint();
}
/**
* @param args the command line arguments
*/
* @param args the command line arguments
*/
public static void main(String args[]) {
EventQueue.invokeLater(() -> new StegSolve().setVisible(true));
}

View File

@@ -214,7 +214,9 @@ public class Stereo extends JFrame
this.setMaximumSize(getToolkit().getScreenSize());
pack();
scrollPane.revalidate();
dp.apply(100);
repaint();
this.setSize(500, 600);
}
}