Commit 396a851f by Facundo Javier Gelatti

Inline embed and extract methods, removing comments

The comments removed talked about GIFShuffle. They are available in the
repository if we need them later.
1 parent bff425a0
......@@ -228,29 +228,22 @@ public class EmbedUi {
private void embedNotifying(EmbeddingProgress progress, String message, String password) {
payload.addBlock(new MessageBlock(message));
payload.setPassword(password);
embed(progress);
try {
embedding.embed(payload, progress, (embeddingMethod, embeddedImage) ->
embeddingComplete(embeddingMethod, embeddedImage)
);
} catch (SteganoEmbedException e) {
displayError("Embedding aborted.", embedButton, e.getMessage());
}
}
private void extractNotifying(EmbeddingProgress progress, String password) {
payload.setPassword(password);
extract(progress);
}
private void extract(EmbeddingProgress progress) {
try {
embedding.extract(payload, progress, (embeddingMethod) ->
extractingComplete(embeddingMethod)
);
} catch (SteganoExtractException e) {
// TODO: disabled until GIFShuffle works
//if (embedding.getEmbeddingMethod() instanceof MyGIFShuffle) {
// LOG.debug("Extracting using GIFShuffle failed. Switching to GIFSortedColorTable.");
// setEmbedding(EmbeddingFactory.GIF_SORTED.newEmbedding(image));
// startExtraction(progress, c1);
// return;
//}
displayError("Extracting aborted.", extractButton, e.getMessage());
}
}
......@@ -296,25 +289,6 @@ public class EmbedUi {
});
}
private void embed(EmbeddingProgress progress) {
try {
embedding.embed(payload, progress, (embeddingMethod, embeddedImage) ->
embeddingComplete(embeddingMethod, embeddedImage)
);
} catch (SteganoEmbedException e) {
// TODO: disabled until GIFShuffle works
//if (embedding.getEmbeddingMethod() instanceof MyGIFShuffle) {
// LOG.debug("Embedding with GIFShuffle failed. Switching to GIFSortedColorTable.");
// setEmbedding(EmbeddingFactory.GIF_SORTED.newEmbedding(image));
// startEmbedding(progress, c1);
// return;
//}
displayError("Embedding aborted.", embedButton, e.getMessage());
}
}
private void embeddingComplete(EmbeddingMethod<? extends ImageFormat> embeddingMethod, ImageFormat embeddedImage) {
Display.getDefault().asyncExec(() -> {
String outputPath = FileUtils.addFileNameSuffix(embeddedImage.getFile().getAbsolutePath(), "_embed");
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!