{"id":18344,"date":"2019-10-14T12:33:08","date_gmt":"2019-10-14T03:33:08","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=18344"},"modified":"2019-10-14T12:33:08","modified_gmt":"2019-10-14T03:33:08","slug":"glide%eb%a5%bc-%ec%82%ac%ec%9a%a9%ed%95%a8%ec%97%90%eb%8f%84-trying-to-draw-too-large-bytes-bitmap-%eb%a9%94%ec%8b%9c%ec%a7%80%ea%b0%80-%eb%82%98%ec%98%a8%eb%8b%a4%eb%a9%b4","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=18344","title":{"rendered":"Glide\ub97c \uc0ac\uc6a9\ud568\uc5d0\ub3c4 trying to draw too large &#8230; bytes bitmap \uba54\uc2dc\uc9c0\uac00 \ub098\uc628\ub2e4\uba74"},"content":{"rendered":"<pre class=\"\"><span>\"Canvas: trying to draw too large(\" <\/span>+ bitmapSize + <span>\"bytes) bitmap.\"<\/span><\/pre>\n<p>\uc704 \uba54\uc2dc\uc9c0\uac00 \ub098\uc624\ub294 \uc0c1\ud669\uc740 DisplayListCanvas\uc5d0 100MB\uc774\uc0c1\uc758 Bitmap\uc744 \uadf8\ub9b4 \ub54c \ub098\uc624\ub294 \uba54\uc2dc\uc9c0\ub2e4.<\/p>\n<p>Glide\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc74c\uc5d0\ub3c4 \ubd88\uad6c\ud558\uace0 \ud574\ub2f9 \uba54\uc2dc\uc9c0\uac00 \ucd9c\ub825\ub418\ub294\uac83\uc744 \ud655\uc778\ud588\ub2e4.<\/p>\n<p>\uc774\uc720\ub294 Aspect Ratio\uac00 \uc544\uc8fc\ud074 \ub54c, \uc608\ub97c\ub4e4\uc5b4 \uc544\uc8fc \uae34 \uc774\ubbf8\uc9c0\ub97c \ucd9c\ub825\ud560 \ub54c \ubb38\uc81c\uac00 \ub418\uc5c8\ub2e4. \uc77c\ubc18\uc801\uc778 \uacbd\uc6b0\uc5d0\ub294 \ubb38\uc81c\uac00 \ub418\uc9c8 \uc54a\uc9c0\ub9cc \ub098\uc758 \uacbd\uc6b0 90\ub3c4 \uc774\ubbf8\uc9c0 \ud68c\uc804\uc744 \uc704\ud574 transform() \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud588\ub2e4. Rotate \ub85c\uc9c1\uc774 \ub9ac\uc0ac\uc774\uc988 \ub41c Bitmap\uc744 \ub9e4\ud2b8\ub9ad\uc2a4 \uc5f0\uc0b0\uc744 \ud55c \ub4a4 \ud0c0\uac9f\ubdf0\uc5d0 \ub9de\uac8c \ub2e4\uc2dc \ub298\ub9ac\ub294 \uacfc\uc815\uc5d0\uc11c \uc6d0\ubcf8\uc774\ubbf8\uc9c0\uc758 Aspect Ratio\uac00 \ud06c\ub2e4\ubcf4\ub2c8 \uc5b4\ub9c8\uc5b4\ub9c8\ud558\uac8c \ud070 Bitmap\uc744 \ub9cc\ub4e4\uc5b4\ubc84\ub838\ub2e4.<\/p>\n<pre class=\"lang:java decode:true\">public static Bitmap rotateImage(@NonNull Bitmap imageToOrient, int degreesToRotate) {\r\n    Bitmap result = imageToOrient;\r\n    try {\r\n      if (degreesToRotate != 0) {\r\n        Matrix matrix = new Matrix();\r\n        matrix.setRotate(degreesToRotate);\r\n        result = Bitmap.createBitmap(imageToOrient, 0, 0, imageToOrient.getWidth(),\r\n            imageToOrient.getHeight(), matrix, true \/*filter*\/);\r\n      }\r\n    } catch (Exception e) {\r\n      if (Log.isLoggable(TAG, Log.ERROR)) {\r\n        Log.e(TAG, \"Exception when trying to orient image\", e);\r\n      }\r\n    }\r\n    return result;\r\n  }<\/pre>\n<p><strong>\ud574\uacb0\ubc29\ubc95\uc740 GlideOption\uc5d0 DownsampleStrategy\ub97c \uc801\uc6a9\ud558\ub294 \uac83\uc774\ub2e4.<\/strong><\/p>\n<p>DownsampleStrategy\ub294 \ucd9c\ub825\ub418\ub294 \uc0ac\uc774\uc988\ub97c \ubcf4\uc7a5\ud558\uc9c0\ub294 \uc54a\uc9c0\ub9cc \uba54\ubaa8\ub9ac\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ud55c\ub2e4.<\/p>\n<p>https:\/\/bumptech.github.io\/glide\/javadocs\/470\/com\/bumptech\/glide\/load\/resource\/bitmap\/DownsampleStrategy.html<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Canvas: trying to draw too large(&#8221; + bitmapSize + &#8220;bytes) bitmap.&#8221; \uc704 \uba54\uc2dc\uc9c0\uac00 \ub098\uc624\ub294 \uc0c1\ud669\uc740 DisplayListCanvas\uc5d0 100MB\uc774\uc0c1\uc758 Bitmap\uc744 \uadf8\ub9b4 \ub54c \ub098\uc624\ub294 \uba54\uc2dc\uc9c0\ub2e4. Glide\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc74c\uc5d0\ub3c4 \ubd88\uad6c\ud558\uace0 \ud574\ub2f9 \uba54\uc2dc\uc9c0\uac00 \ucd9c\ub825\ub418\ub294\uac83\uc744 \ud655\uc778\ud588\ub2e4. \uc774\uc720\ub294 Aspect Ratio\uac00 \uc544\uc8fc\ud074 \ub54c, \uc608\ub97c\ub4e4\uc5b4 \uc544\uc8fc \uae34 \uc774\ubbf8\uc9c0\ub97c \ucd9c\ub825\ud560 \ub54c \ubb38\uc81c\uac00 \ub418\uc5c8\ub2e4. \uc77c\ubc18\uc801\uc778 \uacbd\uc6b0\uc5d0\ub294 \ubb38\uc81c\uac00 \ub418\uc9c8 \uc54a\uc9c0\ub9cc \ub098\uc758 \uacbd\uc6b0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[16],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/18344"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18344"}],"version-history":[{"count":1,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/18344\/revisions"}],"predecessor-version":[{"id":18374,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/18344\/revisions\/18374"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}