<commit_before>package com.wsfmn.view;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.widget.ImageView;

public class AddImageActivity extends AppCompatActivity {

    ImageView image;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_image);

        image = (ImageView)findViewById(R.id.viewImageNew);
        Intent intent = getIntent();
        String photoPath = intent.getStringExtra("CurrentPhotoPath");

        int targetW = 256;
        int targetH = 256;

        int scaleFactor = Math.max(targetH, targetW);
        BitmapFactory.Options bmOptions = new BitmapFactory.Options();
        bmOptions.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(photoPath, bmOptions);

        bmOptions.inJustDecodeBounds = false;
        bmOptions.inSampleSize = scaleFactor;
        bmOptions.inPurgeable = true;
        Bitmap imageBitmap;

        if (!photoPath.startsWith("/storage")) {
            byte[] decodedString = Base64.decode(photoPath, Base64.DEFAULT);
            imageBitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
        } else {
            imageBitmap = BitmapFactory.decodeFile(photoPath);
        }

        image.setImageBitmap(imageBitmap);

    }

}<commit_msg>added TODO in AddImageActvitiy<commit_after>package com.wsfmn.view;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.widget.ImageView;

public class AddImageActivity extends AppCompatActivity {

    ImageView image;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_image);

        image = (ImageView)findViewById(R.id.viewImageNew);
        Intent intent = getIntent();
        String photoPath = intent.getStringExtra("CurrentPhotoPath");

        int targetW = 256;
        int targetH = 256;

        int scaleFactor = Math.max(targetH, targetW);
        BitmapFactory.Options bmOptions = new BitmapFactory.Options();
        bmOptions.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(photoPath, bmOptions);

        bmOptions.inJustDecodeBounds = false;
        bmOptions.inSampleSize = scaleFactor;
        bmOptions.inPurgeable = true;
        Bitmap imageBitmap;

        // TODO: This is brittle, it relies on the device using the directory. Fix by appending a tag to the beginning of the encoded string
        if (!photoPath.startsWith("/storage")) {
            byte[] decodedString = Base64.decode(photoPath, Base64.DEFAULT);
            imageBitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
        } else {
            imageBitmap = BitmapFactory.decodeFile(photoPath);
        }

        image.setImageBitmap(imageBitmap);

    }

}
{'fraction_non_alphanumeric': 0.08819836785938481, 'fraction_numerical': 0.008788449466415568, 'mean_word_length': 3.272117962466488, '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': '5624501', 'n_tokens_mistral': 900, 'n_tokens_neox': 824, 'n_words': 183}