android - java.lang.ArithmeticException: divide by zero when compres image from pick galery -
i getting error java.lang.arithmeticexception: divide zero
when compres image pick galery. code :
public string compressimage(string filepath, string outputfilename) { bitmap scaledbitmap = null; bitmapfactory.options options = new bitmapfactory.options(); options.injustdecodebounds = true; bitmap bmp = bitmapfactory.decodefile(filepath, options); int actualheight = options.outheight; int actualwidth = options.outwidth; log.i("info", "actualheight input: " + actualheight); log.i("info", "actualwidth input: " + actualwidth); float maxheight = 816.0f; float maxwidth = 612.0f; float imgratio = actualwidth / actualheight; float maxratio = maxwidth / maxheight; ............ return outputfilename; }
the error in lin : float imgratio = actualwidth / actualheight;
how fix ?
the fact getting exception says division 0 occurring, , options.outheight
returning zero. need find out why happening. if log.i("info", "actualheight input: " + actualheight);
returns other null
, provide more details.
Android - Java.Lang.Arithmeticexception: Divide By Zero When Compres
ReplyDeleteImage From Pick Galery - >>>>> Download Now
>>>>> Download Full
Android - Java.Lang.Arithmeticexception: Divide By Zero When Compres
Image From Pick Galery - >>>>> Download LINK
>>>>> Download Now
Android - Java.Lang.Arithmeticexception: Divide By Zero When Compres
Image From Pick Galery - >>>>> Download Full
>>>>> Download LINK JG