2

I'm using Creative SDK as photo editor of my selfie app. According to SDK Document, I wrote following code to send an photo to Editor activity.

Uri uri = Uri.fromFile(fileImg);

    //set preview size
    DisplayMetrics dm = DeviceUtils.getDisplayMetrics();
    int max_size = Math.max(dm.widthPixels, dm.heightPixels);
    max_size = (int) ((float) max_size / 1.2f);

    //prepare
    Intent newIntent = new AviaryIntent.Builder(fromAct).setData(uri)
            .withOutput(uri)
            .withOutputFormat(Bitmap.CompressFormat.JPEG)
            .withOutputSize(MegaPixels.Mp5).withNoExitConfirmation(true)
            .saveWithNoChanges(false)
            .withOutputQuality(100)
            .withPreviewSize(max_size)
            .build();

    // ..and start feather
    fromAct.startActivityForResult(newIntent, ACTION_REQUEST_FEATHER);

In Aviary Editor activity, the preview image is too small on HTC device(HTC One M8). It works properly on another device(with full size).

How could I solve it?

reVerse
  • 35,075
  • 22
  • 89
  • 84

2 Answers2

2

A small image loaded on screen depends on different factors:

  • the passed withPreviewSize(max_size) is smaller than the screen size.
  • the image itself is smaller than the screen size.

in your case what is the value of max_size? Try to omit that parameter (the editor activity will try to load the image using an optimal resolution).

Secondly, Are you sure the image you're trying to load is big enough? Try to load that image in your activity and print out the bitmap width and height.

0

So, working well for me with:

.withOutputQuality(100)
.withPreviewSize(2000)