public void removeExifMetadata(final ByteSource byteSource, final OutputStream os) throws ImagingException, IOException, ImagingException {
        final JFIFPieces jfifPieces = analyzeJfif(byteSource);
        final List<JFIFPiece> pieces = jfifPieces.pieces;

        // Debug.debug("pieces", pieces);

        // pieces.removeAll(jfifPieces.exifSegments);

        // Debug.debug("pieces", pieces);

        writeSegmentsReplacingExif(os, pieces, null);
    }
Reads a JPEG image, removes all EXIF metadata (by removing the APP1 segment), and writes the result to a stream.

@param byteSource ByteSource containing JPEG image data.
@param os         OutputStream to write the image to.
@throws ImagingException if it fails to read the JFIF segments
@throws IOException      if it fails to read the image data
@throws ImagingException if it fails to write the updated data
src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java