Commit 81375745 by Tobias

Merge branch 'master' into 'master'

General code clean up

See merge request !3
2 parents a2e4561d 956e3e1a
Showing 65 changed files with 1028 additions and 510 deletions
package org.stegosuite;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.ui.cli.CliParser;
import org.stegosuite.ui.gui.Gui;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
public class Stegosuite {
public static void main(String[] args) {
......@@ -15,7 +14,7 @@ public class Stegosuite {
if (args.length == 0) {
new Gui(null);
} else if (args[0].startsWith("-")) {
new CliParser(args);
new CliParser(args).parse();
} else {
new Gui(args[0]);
}
......
package org.stegosuite.ui.gui;
import java.util.Observable;
import java.util.Observer;
package org.stegosuite.application;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ProgressBar;
import org.stegosuite.image.embedding.EmbeddingProgress;
import java.util.Observable;
import java.util.Observer;
public class EmbeddingProgressObserver
implements Observer {
......
package org.stegosuite.application;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.application.block_processing.BlockProcessor;
import org.stegosuite.application.embedding.Embedding;
import org.stegosuite.application.embedding.EmbeddingDoneListener;
import org.stegosuite.application.embedding.EmbeddingFactory;
import org.stegosuite.application.embedding.ExtractingDoneListener;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.image.embedding.Visualizer;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.model.exception.SteganoEmbedException;
import org.stegosuite.model.exception.SteganoExtractException;
import org.stegosuite.model.exception.SteganoImageException;
import org.stegosuite.model.payload.Payload;
import org.stegosuite.model.payload.block.FileBlock;
import org.stegosuite.model.payload.block.MessageBlock;
import org.stegosuite.util.FileUtils;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
public class StegosuitePresenter implements EmbeddingDoneListener, ExtractingDoneListener {
private ImageFormat image;
private Payload payload;
private Embedding embedding;
private StegosuiteUI ui;
private EmbeddingProgress progressListener = new EmbeddingProgress();
public StegosuitePresenter(ImageFormat image, StegosuiteUI ui) {
this.image = image;
this.ui = ui;
this.payload = new Payload();
this.embedding = embeddingFor(image);
}
private Embedding embeddingFor(ImageFormat image) {
Embedding embedding = EmbeddingFactory.getEmbedding(image);
embedding.setPointFilter(1);
return embedding;
}
public void embedNotifying(EmbeddingProgress progressListener, String message, String password) {
this.progressListener = progressListener;
embed(message, password);
}
public void embed(String message, String password) {
try {
addDataToPayload(message, password);
embedData();
} catch (SteganoEmbedException e) {
ui.showEmbeddingError(e);
}
}
private void addDataToPayload(String message, String password) {
payload.addBlock(new MessageBlock(message));
payload.setPassword(password);
}
private void embedData() throws SteganoEmbedException {
embedding.embed(payload, progressListener, this);
}
@Override
public void onEmbeddingDone(EmbeddingMethod<? extends ImageFormat> embeddingMethod, ImageFormat embeddedImage) {
save(embeddedImage);
notifyEmbeddingCompleted(embeddingMethod, embeddedImage);
}
private void save(ImageFormat embeddedImage) {
try {
String outputPath = getOutputPathFor(embeddedImage);
embeddedImage.save(new File(outputPath));
} catch (SteganoImageException e) {
e.printStackTrace();
}
}
private void notifyEmbeddingCompleted(EmbeddingMethod<? extends ImageFormat> embeddingMethod, ImageFormat embeddedImage) {
Visualizer visualizer = embeddingMethod.getVisualizer();
String outputPath = getOutputPathFor(embeddedImage);
ui.embeddingCompleted(embeddedImage, outputPath, visualizer);
}
private String getOutputPathFor(ImageFormat embeddedImage) {
return FileUtils.addFileNameSuffix(embeddedImage.getFilePath(), "_embed");
}
public void extractNotifying(EmbeddingProgress progressListener, String password) {
this.progressListener = progressListener;
extractUsing(password);
}
public void extractUsing(String password) {
payload.setPassword(password);
try {
embedding.extract(payload, progressListener, this);
} catch (SteganoExtractException e) {
ui.showExtractingError(e);
}
}
@Override
public void onExtractingDone(EmbeddingMethod<? extends ImageFormat> embeddingMethod) {
BlockProcessor blockProcessor = new BlockProcessor(payload, image.getFilePath()).processBlocks();
notifyAddedFiles(blockProcessor.getFilePaths());
notifyExtractingCompleted(embeddingMethod,
blockProcessor.getExtractedMessage(),
blockProcessor.getStatusText()
);
}
private void notifyAddedFiles(List<String> addedFilePaths) {
addedFilePaths.forEach(path -> notifyAddedFile(path));
}
private void notifyExtractingCompleted(EmbeddingMethod<? extends ImageFormat> embeddingMethod, String extractedMessage, String statusText) {
Visualizer visualizer = embeddingMethod.getVisualizer();
ImageData imageData = image.getImageData();
ui.extractingCompleted(extractedMessage, statusText, visualizer, imageData);
}
public void addFileToPayload(String filename) {
payload.addBlock(new FileBlock(filename));
notifyAddedFile(filename);
}
private void notifyAddedFile(String filePath) {
String filename = FileUtils.getFileName(filePath);
String extension = FileUtils.getFileExtension(filePath);
long fileSize = FileUtils.getFileSize(filePath);
ui.addPayloadFile(filename, extension, fileSize);
}
public List<FileBlock> payloadFileBlocksWithFilename(String filename) {
return payload.getBlocks().stream()
.filter(block -> block.hasIdentifier(FileBlock.IDENTIFIER))
.map(block -> (FileBlock) block)
.filter(fileBlock -> fileBlock.hasPath(filename))
.collect(Collectors.toList());
}
public void removeBlock(FileBlock fileBlock) {
payload.removeBlock(fileBlock);
}
public void clearPayload() {
this.payload = new Payload();
}
public int getEmbeddingCapacity() {
return embedding.getCapacity();
}
}
package org.stegosuite.application;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.image.embedding.Visualizer;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.model.exception.SteganoEmbedException;
import org.stegosuite.model.exception.SteganoExtractException;
public interface StegosuiteUI {
void showEmbeddingError(SteganoEmbedException e);
void showExtractingError(SteganoExtractException e);
void extractingCompleted(String extractedMessage, String statusMessage, Visualizer visualizer, ImageData imageData);
void embeddingCompleted(ImageFormat embeddedImage, String outputPath, Visualizer visualizer);
void addPayloadFile(String filename, String extension, long fileSize);
}
package org.stegosuite.application.block_processing;
interface BlockContainer {
void processBlock();
}
package org.stegosuite.application.block_processing;
import org.stegosuite.model.payload.Payload;
import org.stegosuite.model.payload.block.Block;
import org.stegosuite.model.payload.block.FileBlock;
import org.stegosuite.model.payload.block.MessageBlock;
import java.util.ArrayList;
import java.util.List;
public class BlockProcessor {
private final Payload payload;
private final List<String> messages = new ArrayList<>();
private final List<String> filePaths = new ArrayList<>();
private final String baseFilePath;
public BlockProcessor(Payload payload, String baseFilePath) {
this.baseFilePath = baseFilePath;
this.payload = payload;
}
public BlockProcessor processBlocks() {
payload.getBlocks().stream()
.map(block -> toBlockContainer(block))
.forEach(BlockContainer::processBlock);
return this;
}
private BlockContainer toBlockContainer(Block aBlock) {
switch (aBlock.getIdentifier()) {
case FileBlock.IDENTIFIER:
return new FileBlockContainer((FileBlock) aBlock, filePaths, baseFilePath);
case MessageBlock.IDENTIFIER:
return new MessageBlockContainer((MessageBlock) aBlock, messages);
default:
return null;
}
}
public List<String> getFilePaths() {
return filePaths;
}
public String getExtractedMessage() {
return messages.get(0);
}
public String getStatusText() {
String status = "Extracting completed.";
if (thereWereProcessedFiles()) {
status += " Extracted file saved to " + lastFilePath();
}
return status;
}
private boolean thereWereProcessedFiles() {
return !filePaths.isEmpty();
}
private String lastFilePath() {
return filePaths.get(filePaths.size() - 1);
}
}
package org.stegosuite.application.block_processing;
import org.stegosuite.model.payload.block.FileBlock;
import org.stegosuite.util.FileUtils;
import java.util.List;
class FileBlockContainer implements BlockContainer {
private final FileBlock block;
private final List<String> processedFiles;
private final String baseFilePath;
public FileBlockContainer(FileBlock block, List<String> processedFiles, String baseFilePath) {
this.block = block;
this.processedFiles = processedFiles;
this.baseFilePath = baseFilePath;
}
@Override
public void processBlock() {
String extractionPath = getExtractionPath();
block.saveFileTo(extractionPath);
processedFiles.add(extractionPath);
}
private String getExtractionPath() {
return FileUtils.changeFileName(
baseFilePath,
block.getFileName()
);
}
}
package org.stegosuite.application.block_processing;
import org.stegosuite.model.payload.block.MessageBlock;
import java.util.List;
class MessageBlockContainer implements BlockContainer {
private MessageBlock block;
private List<String> processedMessages;
public MessageBlockContainer(MessageBlock block, List<String> messages) {
this.block = block;
this.processedMessages = messages;
}
@Override
public void processBlock() {
String message = block.getMessage();
processedMessages.add(message);
}
}
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.model.exception.SteganoEmbedException;
......@@ -10,20 +10,20 @@ import org.stegosuite.model.payload.Payload;
*/
public abstract class Embedding {
public abstract void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public abstract void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException;
public void embed(Payload payload, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingDoneListener event)
throws SteganoEmbedException {
this.embed(payload, null, event);
}
public abstract void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public abstract void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException;
public void extract(Payload payload, ExtractingDoneEvent event)
public void extract(Payload payload, ExtractingDoneListener listener)
throws SteganoExtractException {
this.extract(payload, null, event);
this.extract(payload, null, listener);
}
public abstract int getCapacity();
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.format.ImageFormat;
public interface EmbeddingDoneEvent {
public interface EmbeddingDoneListener {
/**
* Is fired by the abstraction layer to let the Gui process the embedding result
......@@ -11,6 +11,6 @@ public interface EmbeddingDoneEvent {
* @param embeddingMethod
* @param embeddedImage
*/
void handleEvent(EmbeddingMethod<? extends ImageFormat> embeddingMethod, ImageFormat embeddedImage);
void onEmbeddingDone(EmbeddingMethod<? extends ImageFormat> embeddingMethod, ImageFormat embeddedImage);
}
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.format.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.format.BMPImage;
import org.stegosuite.image.format.GIFImage;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.image.format.JPGImage;
import org.stegosuite.image.format.PNGImage;
/**
* Creates instances of implementations of Embedding.java
*/
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.format.ImageFormat;
public interface ExtractingDoneEvent {
public interface ExtractingDoneListener {
/**
* Is fired by the abstraction layer to let the Gui process the extraction result
*
* @param embeddingMethod
*/
void handleEvent(EmbeddingMethod<? extends ImageFormat> embeddingMethod);
void onExtractingDone(EmbeddingMethod<? extends ImageFormat> embeddingMethod);
}
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
......@@ -28,17 +28,17 @@ public class MyBMPLsbMultiColorChannel
}
@Override
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException {
BMPImage embeddedImage = embeddable.embed(payload, progress);
event.handleEvent(embeddable, embeddedImage);
listener.onEmbeddingDone(embeddable, embeddedImage);
}
@Override
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException {
embeddable.extract(payload, progress);
event.handleEvent(embeddable);
listener.onExtractingDone(embeddable);
}
@Override
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
......@@ -23,17 +23,17 @@ public class MyGIFShuffle
}
@Override
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException {
GIFImage embeddedImage = embeddable.embed(payload, progress);
event.handleEvent(embeddable, embeddedImage);
listener.onEmbeddingDone(embeddable, embeddedImage);
}
@Override
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException {
embeddable.extract(payload, progress);
event.handleEvent(embeddable);
listener.onExtractingDone(embeddable);
}
@Override
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
......@@ -28,17 +28,17 @@ public class MyGIFSortedColorTable
}
@Override
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException {
GIFImage embeddedImage = embeddable.embed(payload, progress);
event.handleEvent(embeddable, embeddedImage);
listener.onEmbeddingDone(embeddable, embeddedImage);
}
@Override
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException {
embeddable.extract(payload, progress);
event.handleEvent(embeddable);
listener.onExtractingDone(embeddable);
}
@Override
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
......@@ -23,17 +23,17 @@ public class MyJPGF5
}
@Override
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException {
JPGImage embeddedImage = embeddable.embed(payload, progress);
event.handleEvent(embeddable, embeddedImage);
listener.onEmbeddingDone(embeddable, embeddedImage);
}
@Override
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException {
embeddable.extract(payload, progress);
event.handleEvent(embeddable);
listener.onExtractingDone(embeddable);
}
@Override
......
package org.stegosuite.ui.gui.embedding;
package org.stegosuite.application.embedding;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.image.embedding.png.PNGLsbMultiColorChannel;
import org.stegosuite.image.embedding.png.filter.PNGPointFilterHomogeneous;
import org.stegosuite.image.embedding.png.filter.PNGPointFilterNone;
import org.stegosuite.image.format.PNGImage;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.image.format.PNGImage;
import org.stegosuite.model.exception.SteganoEmbedException;
import org.stegosuite.model.exception.SteganoExtractException;
import org.stegosuite.model.payload.Payload;
......@@ -28,17 +28,17 @@ public class MyPNGLsbMultiColorChannel
}
@Override
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneEvent event)
public void embed(Payload payload, EmbeddingProgress progress, EmbeddingDoneListener listener)
throws SteganoEmbedException {
PNGImage embeddedImage = embeddable.embed(payload, progress);
event.handleEvent(embeddable, embeddedImage);
listener.onEmbeddingDone(embeddable, embeddedImage);
}
@Override
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneEvent event)
public void extract(Payload payload, EmbeddingProgress progress, ExtractingDoneListener listener)
throws SteganoExtractException {
embeddable.extract(payload, progress);
event.handleEvent(embeddable);
listener.onExtractingDone(embeddable);
}
@Override
......
package org.stegosuite.image.embedding;
import static java.util.stream.Collectors.toMap;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.util.ColorUtils;
import org.stegosuite.util.ImageSwtAwtConverter;
import java.awt.Color;
import java.awt.Point;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.Map;
import org.eclipse.swt.graphics.ImageData;
import org.stegosuite.image.format.ImageFormat;
import org.stegosuite.util.ColorUtils;
import org.stegosuite.util.ImageSwtAwtConverter;
import static java.util.stream.Collectors.toMap;
public class Visualizer {
......
package org.stegosuite.image.embedding.bmp;
import java.awt.Color;
import java.awt.Point;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -24,6 +19,10 @@ import org.stegosuite.model.payload.PayloadExtractor;
import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.RgbChannel;
import java.awt.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Embed/Extract on BMP-images using data-spreading method. This method will utilise all {@code 3}
* color channels, sequentially, meaning the payload will first be embedded into the
......
package org.stegosuite.image.embedding.bmp.filter;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.BMPImage;
import org.stegosuite.model.exception.SteganoImageException;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.List;
/**
* Removes all points that are part of homogeneous areas of a BMP image
*/
......
package org.stegosuite.image.embedding.bmp.filter;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collection;
import org.stegosuite.image.embedding.point.PointFilter;
import org.stegosuite.image.format.BMPImage;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
/**
* Allows embedding into all points of a BMP image
*/
......
package org.stegosuite.image.embedding.gif;
import java.awt.Color;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.stegosuite.image.embedding.EmbeddingMethod;
import org.stegosuite.image.embedding.EmbeddingProgress;
import org.stegosuite.image.embedding.point.PointFilter;
......@@ -24,6 +14,13 @@ import org.stegosuite.util.ByteUtils;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.CryptoUtils;
import java.awt.*;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* GIFShuffle embedding and extracting procedures. Source: http://www.darkside.com.au/gifshuffle/
*
......
package org.stegosuite.image.embedding.gif;
import static java.util.stream.Collectors.toList;
import java.awt.Color;
import java.awt.Point;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.stegosuite.image.embedding.EmbeddingMethod;
......@@ -43,6 +23,18 @@ import org.stegosuite.model.payload.block.MessageBlock;
import org.stegosuite.util.ColorDistance;
import org.stegosuite.util.ColorUtils;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.AbstractMap.SimpleEntry;
import java.util.*;
import java.util.List;
import java.util.Map.Entry;
import static java.util.stream.Collectors.toList;
/**
* "Normal" embedding and extracting procedures for GIF image, i.e. using a sorted color table.
*/
......@@ -243,14 +235,8 @@ public class GIFSortedColorTable
return skipColors.getValue();
}
/**
*
* @param args
* @throws SteganoImageException
* @throws SteganoEmbedException
* @throws SteganoExtractException
* @throws IOException
*/
// TODO: Move this into tests
public static void main(String[] args)
throws SteganoImageException, SteganoEmbedException, SteganoExtractException, IOException {
......@@ -275,10 +261,10 @@ public class GIFSortedColorTable
// Add file to payload
FileBlock fileBlock = new FileBlock(secretFileIn.getAbsolutePath());
payloadToEmbed.getBlocks().add(fileBlock);
payloadToEmbed.addBlock(fileBlock);
MessageBlock messageBlock = new MessageBlock("Some hidden message");
payloadToEmbed.getBlocks().add(messageBlock);
payloadToEmbed.addBlock(messageBlock);
// Embed
embeddingMethod.embed(payloadToEmbed, null);
......@@ -296,11 +282,11 @@ public class GIFSortedColorTable
embeddingMethod.extract(payloadExtracted, null);
// Save extracted contents to file
fileBlock = (FileBlock) payloadExtracted.getBlocks().get(0);
fileBlock = (FileBlock) payloadExtracted.getBlock(0);
LOG.info("Original file name: " + fileBlock.getFileName());