Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: GNU General Public License 

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {
    static public int getImageSize(String albumArtPath) {
        if (albumArtPath != null) {
            BitmapFactory.Options opts = new BitmapFactory.Options();
            opts.inJustDecodeBounds = true;
            Bitmap bmTmp = BitmapFactory.decodeFile(albumArtPath, opts);
            if (bmTmp != null)
                bmTmp.recycle();
            return Math.max(opts.outWidth, opts.outWidth);
        }
        return 0;
    }
}