<commit_before>/**
 * This software is released as part of the Pumpernickel project.
 * 
 * All com.pump resources in the Pumpernickel project are distributed under the
 * MIT License:
 * https://raw.githubusercontent.com/mickleness/pumpernickel/master/License.txt
 * 
 * More information about the Pumpernickel project is available here:
 * https://mickleness.github.io/pumpernickel/
 */
package com.pump.showcase;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;

import com.pump.image.ImageLoader;
import com.pump.image.jpeg.JPEGMetaData;
import com.pump.image.thumbnail.Thumbnail;
import com.pump.util.Warnings;

/**
 * A simple demo for the {@link JPEGMetaData} class.
 * <p>
 * Here is a sample screenshot of this showcase demo:
 * <p>
 * <img src=
 * "https://github.com/mickleness/pumpernickel/raw/master/resources/showcase/JPEGMetaDataDemo.png"
 * alt="A screenshot of the JPEGMetaDataDemo.">
 */
public class JPEGMetaDataDemo extends ShowcaseChartDemo {
	private static final long serialVersionUID = 1L;

	private static final int SAMPLE_COUNT = 10;

	@Override
	public String getTitle() {
		return "JPEGMetaData Demo";
	}

	@Override
	public String getSummary() {
		return "This compares the new JPEGMetaData with ImageIO when reading JPG thumbnails.\n\nNote by default this trial is rigged, because the default installation of ImageIO does not support parsing JPEG thumbnails unless you have JAI also installed. (In this demo: we use ImageIO to load the full image and then scale it down to a thumbnail.)\n\nThe option to request a thumbnail fails with an exception.\n\nSo ... the broad point still stands that this class helps read thumbnails better than Java's default ImageIO classes alone, but these charts are also unfair and biased.";
	}

	@Override
	public URL getHelpURL() {
		return JPEGMetaDataDemo.class.getResource("jpegMetaDataDemo.html");
	}

	@Override
	public String[] getKeywords() {
		return new String[] { "jpeg", "jpg", "thumbnail", "preview", "exif",
				"performance" };
	}

	@Override
	public Class<?>[] getClasses() {
		return new Class[] { JPEGMetaData.class };
	}

	String GROUP_TIME = "Time";
	String GROUP_MEMORY = "Memory";
	long[] sampleTimes = new long[SAMPLE_COUNT];
	long[] sampleMemory = new long[SAMPLE_COUNT];<commit_msg>Shortening text; it didn't read well.<commit_after>/**
 * This software is released as part of the Pumpernickel project.
 * 
 * All com.pump resources in the Pumpernickel project are distributed under the
 * MIT License:
 * https://raw.githubusercontent.com/mickleness/pumpernickel/master/License.txt
 * 
 * More information about the Pumpernickel project is available here:
 * https://mickleness.github.io/pumpernickel/
 */
package com.pump.showcase;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;

import com.pump.image.ImageLoader;
import com.pump.image.jpeg.JPEGMetaData;
import com.pump.image.thumbnail.Thumbnail;
import com.pump.util.Warnings;

/**
 * A simple demo for the {@link JPEGMetaData} class.
 * <p>
 * Here is a sample screenshot of this showcase demo:
 * <p>
 * <img src=
 * "https://github.com/mickleness/pumpernickel/raw/master/resources/showcase/JPEGMetaDataDemo.png"
 * alt="A screenshot of the JPEGMetaDataDemo.">
 */
public class JPEGMetaDataDemo extends ShowcaseChartDemo {
	private static final long serialVersionUID = 1L;

	private static final int SAMPLE_COUNT = 10;

	@Override
	public String getTitle() {
		return "JPEGMetaData Demo";
	}

	@Override
	public String getSummary() {
		return "This compares the new JPEGMetaData with ImageIO when reading JPG thumbnails.";
	}

	@Override
	public URL getHelpURL() {
		return JPEGMetaDataDemo.class.getResource("jpegMetaDataDemo.html");
	}

	@Override
	public String[] getKeywords() {
		return new String[] { "jpeg", "jpg", "thumbnail", "preview", "exif",
				"performance" };
	}

	@Override
	public Class<?>[] getClasses() {
		return new Class[] { JPEGMetaData.class };
	}

	String GROUP_TIME = "Time";
	String GROUP_MEMORY = "Memory";
	long[] sampleTimes = new long[SAMPLE_COUNT];
	long[] sampleMemory = new long[SAMPLE_COUNT];
{'fraction_non_alphanumeric': 0.1068312406895084, 'fraction_numerical': 0.001276867418599702, 'mean_word_length': 4.683192261185006, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6124474', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1483, 'n_words': 440}