@@ -0,0 +1,2894 @@
+package com.cocoahero.android.essentials.graphics;%0A%0Aimport java.io.File;%0A%0Aimport android.graphics.Bitmap;%0Aimport android.graphics.BitmapFactory;%0Aimport android.os.AsyncTask;%0A%0Apublic class BitmapResizeTask extends AsyncTask%3CVoid, Void, Bitmap%3E %7B%0A%0A    // ------------------------------------------------------------------------%0A    // Interfaces%0A    // ------------------------------------------------------------------------%0A%0A    public interface Callback %7B%0A        public void onBitmapResizeFinished(Bitmap resizedBitmap);%0A    %7D%0A%0A    // ------------------------------------------------------------------------%0A    // Instance Variables%0A    // ------------------------------------------------------------------------%0A%0A    private final String mPath;%0A    private final int mWidth;%0A    private final int mHeight;%0A    private Callback mCallback;%0A%0A    // ------------------------------------------------------------------------%0A    // Constructors%0A    // ------------------------------------------------------------------------%0A%0A    public BitmapResizeTask(File file, int width, int height, Callback callback) %7B%0A        this(file.getAbsolutePath(), width, height, callback);%0A    %7D%0A%0A    public BitmapResizeTask(String path, int width, int height, Callback callback) %7B%0A        this.mPath = path;%0A        this.mWidth = width;%0A        this.mHeight = height;%0A        this.mCallback = callback;%0A    %7D%0A%0A    // ------------------------------------------------------------------------%0A    // Public Methods%0A    // ------------------------------------------------------------------------%0A%0A    public void setCallback(Callback callback) %7B%0A        this.mCallback = callback;%0A    %7D%0A%0A    // ------------------------------------------------------------------------%0A    // Protected Methods%0A    // ------------------------------------------------------------------------%0A%0A    @Override%0A    protected Bitmap doInBackground(Void... params) %7B%0A        if (this.mPath != null && this.mPath.length() %3E 0) %7B%0A            BitmapFactory.Options opts = new BitmapFactory.Options();%0A%0A            opts.inJustDecodeBounds = true;%0A%0A            BitmapFactory.decodeFile(this.mPath, opts);%0A%0A            final int w = opts.outWidth;%0A            final int h = opts.outHeight;%0A%0A            opts.inSampleSize = 1;%0A            opts.inJustDecodeBounds = false;%0A%0A            if (h %3E this.mHeight %7C%7C w %3E this.mWidth) %7B%0A                if (w %3E h) %7B%0A                    opts.inSampleSize = Math.round(h / this.mHeight);%0A                %7D%0A                else %7B%0A                    opts.inSampleSize = Math.round(w / this.mWidth);%0A                %7D%0A            %7D%0A            return BitmapFactory.decodeFile(this.mPath, opts);%0A        %7D%0A        return null;%0A    %7D%0A%0A    @Override%0A    protected void onPostExecute(Bitmap result) %7B%0A        if (this.mCallback != null) %7B%0A            this.mCallback.onBitmapResizeFinished(result);%0A        %7D%0A    %7D%0A%7D%0A

Add BitmapResizeTask