Resize bitmap to be smooth and recycle
<p>I am trying to create image from storage to create to be fixed height adn save at the same place with same name with this code</p>

<pre><code>        try {
                    InputStream stream = new FileInputStream(
                            imagePath);
                    Bitmap bitmap = BitmapFactory.decodeStream(stream,
                            null, null);

                    int widthResized=bitmap.getWidth()*ConstantData.IMAGE_HEIGHT/bitmap.getHeight();
                            stream.close();
                    stream = null;
                    Bitmap resized = Bitmap.createScaledBitmap(bitmap, widthResized,
                            Const.IMAGE_HEIGHT, true);
                    OutputStream fOut = null;
                    File file = new File(imagePath);
                    fOut = new FileOutputStream(file);
                    resized.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
                    fOut.flush();
                    fOut.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
</code></pre>

<p>Problem is that on result image when camera resolution is high I get squares at the behind. How to resize to be smooth ? And do I need to put resized.recycle() after fout.close() ?</p>
