mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 22:09:30 +00:00
Improved performances of image downloading
This commit is contained in:
parent
bae12c79dc
commit
486f2e1571
@ -1,5 +1,8 @@
|
|||||||
package org.communiquons.android.comunic.client.data.ImageLoad;
|
package org.communiquons.android.comunic.client.data.ImageLoad;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
|
||||||
import org.communiquons.android.comunic.client.data.Utilities;
|
import org.communiquons.android.comunic.client.data.Utilities;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -57,8 +60,9 @@ class ImageDownloadRunnable implements Runnable {
|
|||||||
//Get input stream
|
//Get input stream
|
||||||
InputStream is = conn.getInputStream();
|
InputStream is = conn.getInputStream();
|
||||||
|
|
||||||
//Transfer bytes
|
//Process image
|
||||||
Utilities.InputToOutputStream(is, os);
|
Bitmap image =BitmapFactory.decodeStream(is);
|
||||||
|
image.compress(Bitmap.CompressFormat.PNG, 100, os);
|
||||||
|
|
||||||
os.close();
|
os.close();
|
||||||
is.close();
|
is.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user