{"id":161027,"date":"2012-12-02T15:40:03","date_gmt":"2012-12-02T11:40:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=161027"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=161027","title":{"rendered":"<span class=\"post_title\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0435\u0437 OutOfMemoryError + \u0430\u0432\u0442\u043e\u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e EXIF orientation<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 OutOfMemoryError \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0439 \u043c\u0430\u043d\u0443\u0430\u043b <a href=\"http:\/\/developer.android.com\/training\/displaying-bitmaps\/index.html\">Displaying Bitmaps Efficiently<\/a>. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u0430, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0432\u043e\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>Bitmap, byte[]<\/li>\n<li>\u0421 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439<\/li>\n<li>C \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u0435\u043c \u043a\u0440\u0430\u0435\u0432 (crop) \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 width x height<\/li>\n<li>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 EXIF orientation, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u043e<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>OutOfMemoryError<\/h4>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430? \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (heap size), \u0440\u0430\u0437\u043d\u043e\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 16\u043c\u0431, 24\u043c\u0431 \u0438 \u0432\u044b\u0448\u0435. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u043c\u0435\u044e\u0442 24\u043c\u0431 \u0438 \u0432\u044b\u0448\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0438 \u044d\u0442\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u00ab\u0441\u044a\u0435\u0441\u0442\u044c\u00bb. <\/p>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0433\u043b\u043e\u0449\u0430\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c? \u041e\u0442\u0432\u0435\u0442 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Bitmap, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0438\u043a\u0441\u0435\u043b \u0442\u0440\u0430\u0442\u0438\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 2 \u0438\u043b\u0438 4 \u0431\u0430\u0439\u0442\u0430 (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2013 16\u0431\u0438\u0442 RGB_555 \u0438\u043b\u0438 32 \u0431\u0438\u0442\u0430 ARGB_888). \u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u044a\u0435\u0441\u0442 Bitmap, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043d\u044f\u0442\u043e\u0435 \u043d\u0430 5 \u043c\u0435\u0433\u0430\u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u0430\u043c\u0435\u0440\u0443.<\/p>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0442\u043e\u0440\u043e\u043d 4:3 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c\u0438 2583 \u0445 1936. \u0412 RGB_555 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448 Bitmap \u0437\u0430\u0439\u043c\u0435\u0442 2583 * 1936 * 2 = 9.54\u041c\u0431 (\u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u041c\u0431 = 2 \u0432 20 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0431\u0430\u0439\u0442), \u0430 \u0432 ARGB_888 \u0432 2 \u0440\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u2013 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 19\u041c\u0431. \u041f\u0440\u043e \u043a\u0430\u043c\u0435\u0440\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u0433\u0430\u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u0448\u043d\u043e.<\/p>\n<h5>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0438 \u044f\u0441\u043d\u043e.<\/h5>\n<p>  1) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e BitmapFactory.decodeStream \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0440\u0435\u0442\u044c\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c new BitmapFactory.Options(), \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e inJustDecodeBounds = true \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c Bitmap \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u0430\u0445 \u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u0430\u043c\u0438\u0445 \u043f\u0438\u043a\u0441\u0435\u043b\u043e\u0432.<br \/>  2) \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b. <br \/>  3) \u041f\u0440\u0438\u0441\u0432\u0430\u0435\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u0435 inSampleSize \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 BitmapFactory.Options \u0438 \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e BitmapFactory.decodeStream. <br \/>  4) \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0435\u043a\u043e\u0434\u0435\u0440 \u0432\u0435\u0440\u043d\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 OutOfMemoryError<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u044d\u043a\u0440\u0430\u043d\u0430. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u044c Bitmap \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 ARGB_888, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0435\u0432\u0430\u0439\u0441\u044b \u0438\u043c\u0435\u044e\u0442 16 \u0431\u0438\u0442\u043d\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b. \u041d\u043e \u0434\u0430\u0436\u0435 \u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0446\u0432\u0435\u0442\u0430\u0441\u0442\u044b\u0445 \u044d\u043a\u0440\u0430\u043d\u0430\u0445 \u0432\u044b\u0433\u043e\u0434\u0430 \u043e\u0442 \u0434\u0432\u0443\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (\u0418\u041c\u0425\u041e).<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">InputStream in = ... \/\/\u0412\u0430\u0448 InputStream BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(in, null, o); in.close(); int origWidth = o.outWidth; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430  int origHeight = o.outHeight; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430  int bytesPerPixel = 2 \/\/\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 RGB_555 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 int maxSize = 480 * 800 * bytesPerPixel; \/\/\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 Bitmap int desiredWidth = \u2026; \/\/\u041d\u0443\u0436\u043d\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430 int desiredHeight = \u2026; \/\/\u041d\u0443\u0436\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430 int desiredSize = _ desiredWidth * _ desiredHeight * bytesPerPixel; \/\/\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 Bitmap \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 width \u0445 height if (desiredSize &lt; maxSize) maxSize = desiredSize; int scale = 1; \/\/\u043a\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f int origSize = origWidth * origHeight * bytesPerPixel; \/\/\u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f if (origWidth &gt; origHeight) {     scale = Math.round((float) origHeight \/ (float) desiredHeight); } else {     scale = Math.round((float) origWidth \/ (float) desiredWidth); }  o = new BitmapFactory.Options(); o.inSampleSize = scale; o.inPreferredConfig = Config.RGB_565;              in = \u2026 \/\/\u0412\u0430\u0448 InputStream. \u0412\u0430\u0436\u043d\u043e - \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0435 \u0440\u0430\u0437, \u0442.\u043a \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 InputStream \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f (\u041f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 ByteArrayInputStream \u0438 FileInputStream). Bitmap bitmap = BitmapFactory.decodeStream(in, null, o); \/\/\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 Bitmap <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h5>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0448\u0438\u0440\u0438\u043d\u0435 \u0438 \u0432\u044b\u0441\u043e\u0442\u0435 \u0432\u0430\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e Bitmap\u2019\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u0441\u0430\u0439\u0437\u0438\u043c \u0438\/\u0438\u043b\u0438 \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u043e\u0441\u0442\u0430.<\/p>\n<h1>EXIF orientation \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/h1>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0444\u043e\u0440\u043c\u0430\u0442\u0443 jpeg.<\/p>\n<p>  \u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044b \u0442\u0430\u043a, \u043a\u0430\u043a \u043c\u044b \u0438\u0445 \u0432\u0438\u0434\u0438\u043c \u2013 \u043d\u0435\u0442. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0443\u0433\u043e\u043b \u2013 \u0438 \u0432\u043e\u0442 \u0432\u0430\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c. \u041d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043c\u0430 \u0438 \u043b\u044e\u0434\u0438 \u0441\u0442\u043e\u044f\u043b\u0438 \u043d\u0430 \u0437\u0435\u043c\u043b\u0435, \u0430 \u043f\u0442\u0438\u0446\u044b \u043b\u0435\u0442\u0435\u043b\u0438 \u043f\u043e \u043d\u0435\u0431\u0443. \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c EXIF \u2013 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c. <\/p>\n<p>  \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2013 orientation. \u041d\u043e \u0432 \u0441\u044b\u0440\u043e\u043c \u0432\u0438\u0434\u0435 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0435 \u0433\u0440\u0430\u0434\u0443\u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0430 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1-8. \u0427\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"http:\/\/beradrian.wordpress.com\/2008\/11\/14\/rotate-exif-images\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u0443\u0447\u0438\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u043e\u0441\u0442\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u044b: getOrientation(Context context, Uri uri). \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 90, 180, 270 \u0438\u043b\u0438 -1 (\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f).<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043a\u0443\u0440\u0441, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"java\">int origWidth = o.outWidth; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430  int origHeight = o.outHeight; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430 <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c:<\/p>\n<pre><code class=\"java\">int origWidth = 0; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430  int origHeight = 0; \/\/\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0432\u044b\u0441\u043e\u0442\u0430 if (orientation == 90 || orientation == 270) {   origWidth = o.outHeight;   origHeight = o.outWidth; } else {   origWidth = o.outWidth;   origHeight = o.outHeight;  } <\/code><\/pre>\n<p>  \u0410 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<\/p>\n<pre><code class=\"java\">            if (orientation &gt; 0) {                 Matrix matrix = new Matrix();                 matrix.postRotate(orientation);                 Bitmap decodedBitmap = bitmap;                 bitmap = Bitmap.createBitmap(decodedBitmap, 0, 0, bitmap.getWidth(),                         bitmap.getHeight(), matrix, true); \t          \/\/\u0440\u0435\u0446\u0430\u0439\u043a\u043b\u0438\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0438\u0442\u043c\u0430\u043f \u0437\u0430 \u043d\u0435\u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e                 if (decodedBitmap != null && !decodedBitmap.equals(bitmap)) {                     decodedBitmap.recycle();                 }             } <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0441\u0435\u0439 \u043c\u0430\u043d\u0443\u0430\u043b \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0443 \u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043d\u043e \u0438 \u0434\u0430\u0441\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0418\u0431\u043e \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u044b\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0435, \u043d\u043e \u0432 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 ImageManager<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public final class ImageManager {         private Context _ctx;     private int _boxWidth;     private int _boxHeight;     private ResizeMode _resizeMode;     private ScaleMode _scaleMode;     private Config _rgbMode;     private boolean _isScale;     private boolean _isResize;     private boolean _isCrop;     private boolean _isRecycleSrcBitmap;     private boolean _useOrientation;          public ImageManager(Context ctx, int boxWidth, int boxHeight) {         this(ctx);         _boxWidth = boxWidth;         _boxHeight = boxHeight;     }          public ImageManager(Context ctx) {         _ctx = ctx;         _isScale = false;         _isResize = false;         _isCrop = false;         _isRecycleSrcBitmap = true;         _useOrientation = false;     }          public ImageManager setResizeMode(ResizeMode mode) {         _resizeMode = mode;         return this;     }          public ImageManager setScaleMode(ScaleMode mode) {         _scaleMode = mode;         return this;     }          public ImageManager setRgbMode(Config mode) {         _rgbMode = mode;         return this;     }          public ImageManager setIsScale(boolean isScale) {         _isScale = isScale;         return this;     }          public ImageManager setIsResize(boolean isResize) {         _isResize = isResize;         return this;     }          public ImageManager setIsCrop(boolean isCrop) {         _isCrop = isCrop;         return this;     }          public ImageManager setUseOrientation(boolean value) {         _useOrientation = value;         return this;     }          public ImageManager setIsRecycleSrcBitmap(boolean value) {         _isRecycleSrcBitmap = value;         return this;     }          public Bitmap getFromFile(String path) {         Uri uri = Uri.parse(path);         int orientation = -1;         if (_useOrientation) {             orientation = getOrientation(_ctx, uri);         }         Bitmap bitmap = scale(new StreamFromFile(_ctx, path), orientation);         return getFromBitmap(bitmap);     }          public Bitmap getFromBitmap(Bitmap bitmap) {         if (bitmap == null) return null;         if (_isResize) bitmap = resize(bitmap);         if (_isCrop) bitmap = crop(bitmap);         return bitmap;     }          public byte[] getRawFromFile(String path) {         return getRawFromFile(path, 75);     }      public byte[] getRawFromFile(String path, int compressRate) {         Bitmap scaledBitmap = getFromFile(path);         if (scaledBitmap == null) return null;                  ByteArrayOutputStream output = new ByteArrayOutputStream();         scaledBitmap.compress(CompressFormat.JPEG, compressRate, output);         recycleBitmap(scaledBitmap);                  byte[] rawImage = output.toByteArray();         if (rawImage == null) {              return null;         }                  return rawImage;     }          public Bitmap getFromByteArray(byte[] rawImage) {         Bitmap bitmap = scale(new StreamFromByteArray(rawImage), -1);         return getFromBitmap(bitmap);     }          @SuppressLint(&quot;NewApi&quot;)     private Bitmap scale(IStreamGetter streamGetter, int orientation) {                 try {             InputStream in = streamGetter.Get();             if (in == null) return null;                          Bitmap bitmap = null;             Config rgbMode = _rgbMode != null ? _rgbMode : Config.RGB_565;                          if (!_isScale) {                 BitmapFactory.Options o = new BitmapFactory.Options();                 o.inPreferredConfig = rgbMode;                 if (android.os.Build.VERSION.SDK_INT &gt;= 11) {                     o.inMutable = true;                 }                 bitmap = BitmapFactory.decodeStream(in, null, o);                 in.close();                 return bitmap;             }                          if (_boxWidth == 0 || _boxHeight == 0) {                  if (in != null) in.close();                 return null;             }                          ScaleMode scaleMode = _scaleMode != null ? _scaleMode : ScaleMode.EQUAL_OR_GREATER;             int bytesPerPixel = rgbMode == Config.ARGB_8888 ? 4 : 2;             int maxSize = 480 * 800 * bytesPerPixel;             int desiredSize = _boxWidth * _boxHeight * bytesPerPixel;             if (desiredSize &lt; maxSize) maxSize = desiredSize;                          BitmapFactory.Options o = new BitmapFactory.Options();             o.inJustDecodeBounds = true;             BitmapFactory.decodeStream(in, null, o);             in.close();             int scale = 1;                          int origWidth;             int origHeight;             if (orientation == 90 || orientation == 270) {                 origWidth = o.outHeight;                 origHeight = o.outWidth;             } else {                 origWidth = o.outWidth;                 origHeight = o.outHeight;             }                          while ((origWidth * origHeight * bytesPerPixel) * (1 \/ Math.pow(scale, 2)) &gt; maxSize) {                 scale++;             }             if (scaleMode == ScaleMode.EQUAL_OR_LOWER) {                 scale++;             }                          o = new BitmapFactory.Options();             o.inSampleSize = scale;             o.inPreferredConfig = rgbMode;                          in = streamGetter.Get();             if (in == null) return null;             bitmap = BitmapFactory.decodeStream(in, null, o);             in.close();                          if (orientation &gt; 0) {                 Matrix matrix = new Matrix();                 matrix.postRotate(orientation);                 Bitmap decodedBitmap = bitmap;                 bitmap = Bitmap.createBitmap(decodedBitmap, 0, 0, bitmap.getWidth(),                         bitmap.getHeight(), matrix, true);                 if (decodedBitmap != null && !decodedBitmap.equals(bitmap)) {                     recycleBitmap(decodedBitmap);                 }             }                          return bitmap;         }         catch (IOException e) {              return null;         }     }          private Bitmap resize(Bitmap sourceBitmap) {         if (sourceBitmap == null) return null;         if (_resizeMode == null) _resizeMode = ResizeMode.EQUAL_OR_GREATER;         float srcRatio;         float boxRatio;         int srcWidth = 0;         int srcHeight = 0;         int resizedWidth = 0;         int resizedHeight = 0;          srcWidth = sourceBitmap.getWidth();         srcHeight = sourceBitmap.getHeight();          if (_resizeMode == ResizeMode.EQUAL_OR_GREATER && (srcWidth &lt;= _boxWidth || srcHeight &lt;= _boxHeight) ||             _resizeMode == ResizeMode.EQUAL_OR_LOWER && srcWidth &lt;= _boxWidth && srcHeight &lt;= _boxHeight) {              return sourceBitmap;         }                  srcRatio = (float)srcWidth \/ (float)srcHeight;         boxRatio = (float)_boxWidth \/ (float)_boxHeight;          if (srcRatio &gt; boxRatio && _resizeMode == ResizeMode.EQUAL_OR_GREATER ||             srcRatio &lt; boxRatio && _resizeMode == ResizeMode.EQUAL_OR_LOWER) {             resizedHeight = _boxHeight;             resizedWidth = (int)((float)resizedHeight * srcRatio);         }         else {             resizedWidth = _boxWidth;             resizedHeight = (int)((float)resizedWidth \/ srcRatio);         }                  Bitmap resizedBitmap = Bitmap.createScaledBitmap(sourceBitmap, resizedWidth, resizedHeight, true);                  if (_isRecycleSrcBitmap && !sourceBitmap.equals(resizedBitmap)) {             recycleBitmap(sourceBitmap);         }          return resizedBitmap;     }          private Bitmap crop(Bitmap sourceBitmap) {         if (sourceBitmap == null) return null;         int srcWidth = sourceBitmap.getWidth();         int srcHeight = sourceBitmap.getHeight();         int croppedX = 0;         int croppedY = 0;                  croppedX = (srcWidth &gt; _boxWidth) ? (int)((srcWidth - _boxWidth) \/ 2) : 0;         croppedY = (srcHeight &gt; _boxHeight) ? (int)((srcHeight - _boxHeight) \/ 2) : 0;                  if (croppedX == 0 && croppedY == 0)              return sourceBitmap;                  Bitmap croppedBitmap = null;         try {             croppedBitmap = Bitmap.createBitmap(sourceBitmap, croppedX, croppedY, _boxWidth, _boxHeight);         }         catch(Exception e) {          }         if (_isRecycleSrcBitmap && !sourceBitmap.equals(croppedBitmap)) {             recycleBitmap(sourceBitmap);         }          return croppedBitmap;     }          public static void recycleBitmap(Bitmap bitmap) {         if (bitmap == null || bitmap.isRecycled()) return;         bitmap.recycle();         System.gc();     }          private static interface IStreamGetter {         public InputStream Get();     }          private static class StreamFromFile implements IStreamGetter {         private String _path;         private Context _ctx;         public StreamFromFile(Context ctx, String path) {             _path = path;             _ctx = ctx;         }         @SuppressWarnings(&quot;resource&quot;)         public InputStream Get() {             try {                 Uri uri = Uri.parse(_path);                 return &quot;content&quot;.equals(uri.getScheme())                          ? _ctx.getContentResolver().openInputStream(uri)                         : new FileInputStream(_path);             }             catch (FileNotFoundException e) {                  return null;             }         }     }          private static class StreamFromByteArray implements IStreamGetter {         private byte[] _rawImage;         public StreamFromByteArray(byte[] rawImage) {             _rawImage = rawImage;         }         public InputStream Get() {             if (_rawImage == null) return null;             return new ByteArrayInputStream(_rawImage);         }     }          private static int getOrientation(Context context, Uri uri) {         if (&quot;content&quot;.equals(uri.getScheme())) {             Cursor cursor = context.getContentResolver().query(uri,                     new String[] { MediaStore.Images.ImageColumns.ORIENTATION }, null, null, null);                          if (cursor == null || cursor.getCount() != 1) {                 return -1;             }                  cursor.moveToFirst();             int orientation = cursor.getInt(0);             cursor.close();             return orientation;         }         else {             try {                 ExifInterface exif = new ExifInterface(uri.getPath());                 int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);                 switch (orientation) {                     case ExifInterface.ORIENTATION_ROTATE_270:                         return 270;                     case ExifInterface.ORIENTATION_ROTATE_180:                         return 180;                     case ExifInterface.ORIENTATION_ROTATE_90:                         return 90;                     default:                         return -1;                 }             } catch (IOException e) {                 return -1;             }         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/161027\/\"> http:\/\/habrahabr.ru\/post\/161027\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 OutOfMemoryError \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0439 \u043c\u0430\u043d\u0443\u0430\u043b <a href=\"http:\/\/developer.android.com\/training\/displaying-bitmaps\/index.html\">Displaying Bitmaps Efficiently<\/a>. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u0430, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0432\u043e\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>Bitmap, byte[]<\/li>\n<li>\u0421 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0439<\/li>\n<li>C \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u0435\u043c \u043a\u0440\u0430\u0435\u0432 (crop) \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 width x height<\/li>\n<li>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 EXIF orientation, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u043e<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-161027","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161027"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161027\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}