// Path: webimageloader/src/main/java/com/webimageloader/util/InputSupplier.java
// public interface InputSupplier {
//     /**
//      * Get the length of the supplied {@link InputStream}
//      *
//      * @return the length
//      * @throws IOException if opening the stream or file failed
//      */
//     long getLength() throws IOException;
// 
//     /**
//      * Open a new {@link InputStream}, you should be sure to close any previously
//      * opened streams before
//      *
//      * @return a fresh stream which you are responsible for closing
//      * @throws IOException if opening the stream failed
//      */
//     InputStream getInput() throws IOException;
// }


import java.io.IOException;
import java.io.InputStream;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.webimageloader.util.InputSupplier;
package com.webimageloader.transformation;




/**
 * Scale an image to the specified size, it is safe to use
 * this transformation on very large images as it loads the
 * images using a sample size, as described in Android Training
 *
 * @author Alexander Blom <alexanderblom.se>
 */
public class ScaleTransformation extends SimpleTransformation {
    private int reqWidth;
    private int reqHeight;

    /**
     * Create a new scale transformation which will scale the image to
     * the specified required size. The image can however be slightly larger
     * than the size specified.
     *
     * @param reqWidth required width, the image will not be smaller than this
     * @param reqHeight required height, the image will not be smaller than this
     */
    public ScaleTransformation(int reqWidth, int reqHeight) {
        this.reqWidth = reqWidth;
        this.reqHeight = reqHeight;
    }

    @Override
    public String getIdentifier() {
        return "webimageloader_scale-" + reqWidth + "x" + reqHeight;
    }

    @Override
// Path: webimageloader/src/main/java/com/webimageloader/util/InputSupplier.java
// public interface InputSupplier {
//     /**
//      * Get the length of the supplied {@link InputStream}
//      *
//      * @return the length
//      * @throws IOException if opening the stream or file failed
//      */
//     long getLength() throws IOException;
// 
//     /**
//      * Open a new {@link InputStream}, you should be sure to close any previously
//      * opened streams before
//      *
//      * @return a fresh stream which you are responsible for closing
//      * @throws IOException if opening the stream failed
//      */
//     InputStream getInput() throws IOException;
// }


// Path: webimageloader/src/main/java/com/webimageloader/transformation/ScaleTransformation.java
import java.io.IOException;
import java.io.InputStream;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.webimageloader.util.InputSupplier;

package com.webimageloader.transformation;




/**
 * Scale an image to the specified size, it is safe to use
 * this transformation on very large images as it loads the
 * images using a sample size, as described in Android Training
 *
 * @author Alexander Blom <alexanderblom.se>
 */
public class ScaleTransformation extends SimpleTransformation {
    private int reqWidth;
    private int reqHeight;

    /**
     * Create a new scale transformation which will scale the image to
     * the specified required size. The image can however be slightly larger
     * than the size specified.
     *
     * @param reqWidth required width, the image will not be smaller than this
     * @param reqHeight required height, the image will not be smaller than this
     */
    public ScaleTransformation(int reqWidth, int reqHeight) {
        this.reqWidth = reqWidth;
        this.reqHeight = reqHeight;
    }

    @Override
    public String getIdentifier() {
        return "webimageloader_scale-" + reqWidth + "x" + reqHeight;
    }

    @Override
    public Bitmap transform(InputSupplier input) throws IOException {