android - How can I get image width & height prior to loading with Picasso? -


when use resize, image width & height match screen. trying detect orientation. if don't use resize, application may crash running out of memory.

backgroundtarget = new target() {             @override             public void onbitmaploaded(bitmap bitmap, picasso.loadedfrom from) {                 log.v("biscuit-width", string.valueof(bitmap.getwidth()));                 log.v("biscuit-height", string.valueof(bitmap.getheight()));                  mainlayout.setbackground(new bitmapdrawable(context.getresources(), bitmap));             }    display display = getwindowmanager().getdefaultdisplay();         point size = new point();         display.getsize(size);          picasso.with(this).load(imagepath).resize(size.x, size.y).into(backgroundtarget); 

how can image width & height without loading image memory?


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -