<commit_before>package im.actor.android;

import android.content.Context;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import android.webkit.MimeTypeMap;

import java.io.File;
import java.io.IOException;
import java.util.Random;

import im.actor.android.images.ImageHelper;
import im.actor.model.BaseMessenger;
import im.actor.model.Configuration;
import im.actor.model.entity.Peer;
import im.actor.model.entity.content.FastThumb;

/**
 * Created by ex3ndr on 23.03.15.
 */
public class AndroidMessenger extends BaseMessenger {
    private Context context;
    private Random random = new Random();

    public AndroidMessenger(Context context, Configuration configuration) {
        super(configuration);
        this.context = context;
    }

    @Override
    public void changeAvatar(String descriptor) {
        try {
            Bitmap bmp = ImageHelper.loadOptimizedHQ(descriptor);
            if (bmp == null) {
                return;
            }
            String resultFileName = getExternalTempFile("image", "jpg");
            if (resultFileName == null) {
                return;
            }
            ImageHelper.save(bmp, resultFileName);

            super.changeAvatar(resultFileName);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
<commit_msg>fix(android): Fixed group avatar orientation<commit_after>package im.actor.android;

import android.content.Context;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import android.webkit.MimeTypeMap;

import java.io.File;
import java.io.IOException;
import java.util.Random;

import im.actor.android.images.ImageHelper;
import im.actor.model.BaseMessenger;
import im.actor.model.Configuration;
import im.actor.model.entity.Peer;
import im.actor.model.entity.content.FastThumb;

/**
 * Created by ex3ndr on 23.03.15.
 */
public class AndroidMessenger extends BaseMessenger {
    private Context context;
    private Random random = new Random();

    public AndroidMessenger(Context context, Configuration configuration) {
        super(configuration);
        this.context = context;
    }

    @Override
    public void changeGroupAvatar(int gid, String descriptor) {
        try {
            Bitmap bmp = ImageHelper.loadOptimizedHQ(descriptor);
            if (bmp == null) {
                return;
            }
            String resultFileName = getExternalTempFile("image", "jpg");
            if (resultFileName == null) {
                return;
            }
            ImageHelper.save(bmp, resultFileName);

            super.changeGroupAvatar(gid, resultFileName);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void changeAvatar(String descriptor) {
        try {
            Bitmap bmp = ImageHelper.loadOptimizedHQ(descriptor);
            if (bmp == null) {
                return;
            }
            String resultFileName = getExternalTempFile("image", "jpg");
            if (resultFileName == null) {
                return;
            }
            ImageHelper.save(bmp, resultFileName);

            super.changeAvatar(resultFileName);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

{'fraction_non_alphanumeric': 0.09600731484303567, 'fraction_numerical': 0.004266991770801585, 'mean_word_length': 2.41875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1697630', 'n_tokens_mistral': 897, 'n_tokens_neox': 855, 'n_words': 195}