+ options.inJustDecodeBounds = false;\r
+\r
+ int width = options.outWidth;\r
+ int height = options.outHeight;\r
+ int scale = 1;\r
+ boolean recycle = false;\r
+ if (width >= 2048 || height >= 2048) {\r
+ scale = (int) Math.ceil((Math.ceil(Math.max(height, width) / 2048.)));\r
+ options.inSampleSize = scale;\r
+ }\r
+ Display display = getActivity().getWindowManager().getDefaultDisplay();\r
+ Point size = new Point();\r
+ int screenwidth;\r
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {\r
+ display.getSize(size);\r
+ screenwidth = size.x;\r
+ } else {\r
+ screenwidth = display.getWidth();\r
+ }\r