<commit_before>/*
 * Copyright (C) 2012, 2013 the diamond:dogs|group
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package at.diamonddogs.service.processor;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.net.URL;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import at.diamonddogs.data.adapter.ReplyAdapter;
import at.diamonddogs.data.adapter.ReplyAdapter.Status;
import at.diamonddogs.data.dataobjects.CacheInformation;
import at.diamonddogs.data.dataobjects.Request;
import at.diamonddogs.data.dataobjects.WebRequest;
import at.diamonddogs.exception.ProcessorExeception;
import at.diamonddogs.util.CacheManager;
import at.diamonddogs.util.CacheManager.CachedObject;
import at.diamonddogs.util.Utils;

/**
 * This processor should be used if the data returned by the {@link WebRequest}
 * contains an image. This {@link ServiceProcessor} handles caching and handles
 * image creation.
 */
public class ImageProcessor extends DataProcessor<Bitmap, Bitmap> {

	/**
	 * The processor id
	 */
	public static final int ID = 13452;

	/**
	 * {@link Bundle} key that is used to store the image
	 */
	public static final String BUNDLE_EXTRA_BITMAP = "BUNDLE_EXTRA_BITMAP";

	private static final Logger LOGGER = LoggerFactory.getLogger(ImageProcessor.class);<commit_msg>added todo in imageprocessor, we need to rewrite that thing ;)<commit_after>/*
 * Copyright (C) 2012, 2013 the diamond:dogs|group
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package at.diamonddogs.service.processor;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.net.URL;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import at.diamonddogs.data.adapter.ReplyAdapter;
import at.diamonddogs.data.adapter.ReplyAdapter.Status;
import at.diamonddogs.data.dataobjects.CacheInformation;
import at.diamonddogs.data.dataobjects.Request;
import at.diamonddogs.data.dataobjects.WebRequest;
import at.diamonddogs.exception.ProcessorExeception;
import at.diamonddogs.util.CacheManager;
import at.diamonddogs.util.CacheManager.CachedObject;
import at.diamonddogs.util.Utils;

/**
 * This processor should be used if the data returned by the {@link WebRequest}
 * contains an image. This {@link ServiceProcessor} handles caching and handles
 * image creation.
 * 
 * TODO: deprecate ImageProcessor and implement a v2 that follows the
 * ServiceProcessor protocol, also separate concerns like creating default image
 * webrequests etc
 */
public class ImageProcessor extends DataProcessor<Bitmap, Bitmap> {

	/**
	 * The processor id
	 */
	public static final int ID = 13452;

	/**
	 * {@link Bundle} key that is used to store the image
	 */
	public static final String BUNDLE_EXTRA_BITMAP = "BUNDLE_EXTRA_BITMAP";

	private static final Logger LOGGER = LoggerFactory.getLogger(ImageProcessor.class);
{'fraction_non_alphanumeric': 0.08583783783783784, 'fraction_numerical': 0.008432432432432432, 'mean_word_length': 4.984476067270375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1115144', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1258, 'n_words': 428}