public static String getComment(final Metadata metadata) {
        return safeProcess("comment", metadata, null, () -> {
            final StringBuilder comment = new StringBuilder();

            final Collection<ExifIFD0Directory> exifDirs = metadata.getDirectoriesOfType(ExifIFD0Directory.class);
            for (ExifIFD0Directory dir : exifDirs) {
                addIf(comment, dir.getString(ExifDirectoryBase.TAG_IMAGE_DESCRIPTION));
                addIf(comment, dir.getString(ExifDirectoryBase.TAG_USER_COMMENT));
                addIf(comment, dir.getString(ExifDirectoryBase.TAG_WIN_SUBJECT));
                addIf(comment, dir.getString(ExifDirectoryBase.TAG_WIN_COMMENT));
                addIf(comment, dir.getString(ExifDirectoryBase.TAG_WIN_KEYWORDS));
            }

            final Collection<JpegCommentDirectory> commentDirectories = metadata.getDirectoriesOfType(JpegCommentDirectory.class);

            for (final JpegCommentDirectory commentDirectory : commentDirectories) {
                addIf(comment, commentDirectory.getString(0));
            }

            final Collection<EpsDirectory> epsDirs = metadata.getDirectoriesOfType(EpsDirectory.class);
            for (final EpsDirectory dir : epsDirs) {
                addIf(comment, dir.getString(EpsDirectory.TAG_KEYWORDS));
            }

            final Collection<IptcDirectory> iptcDirs = metadata.getDirectoriesOfType(IptcDirectory.class);
            for (final IptcDirectory dir : iptcDirs) {
                addIf(comment, dir.getString(IptcDirectory.TAG_KEYWORDS));
            }
            final Collection<QuickTimeMetadataDirectory> quickDirs = metadata.getDirectoriesOfType(QuickTimeMetadataDirectory.class);
            for (final QuickTimeMetadataDirectory dir : quickDirs) {
                addIf(comment, dir.getString(QuickTimeMetadataDirectory.TAG_KEYWORDS));
            }
            return comment.toString();
        });
    }
Tries to read metadata from given stream, assuming it is an image data stream

@param description describes the stream. Used for logging in case of errors
@param imageStream image data stream
@param closeAfter  if true, stream is closed after read
@return Metadata read, or null if metadata could not be read
main/src/main/java/cgeo/geocaching/utils/MetadataUtils.java