throws ImageReadException, IOException, ImageWriteException {
// List outputDirectories = outputSet.getDirectories();
final JFIFPieces jfifPieces = analyzeJFIF(byteSource);
final List<JFIFPiece> pieces = jfifPieces.pieces;
TiffImageWriterBase writer;
// Just use first APP1 segment for now.
// Multiple APP1 segments are rare and poorly supported.
if (jfifPieces.exifPieces.size() > 0) {
JFIFPieceSegment exifPiece = null;
exifPiece = (JFIFPieceSegment) jfifPieces.exifPieces.get(0);