2012-11-20 3 views
7

내 안드로이드 응용 프로그램에서 Aviary를 사용하여 이미지를 편집하고 있지만 되돌아 오는 이미지가 원본보다 작음을 발견했습니다.Aviary에서 반환 한 이미지의 크기가 원래보다 작습니다.

예를 들어, 나는 큰 이미지 2560x1920을 조류 사육장으로 지나쳤지만 반환하는 이미지는 480x640입니다.

private void startFeather(Intent data) { 
    File file = getBitmapFromResult(data); 

    BitmapInfo bitmap = Helper.getBitmap(file, App.screenWidth, 0); 
    toastLong("raw photo: " + bitmap.getWidth() + "x" + bitmap.getHeight()); 

    Uri uri = Uri.fromFile(file); 

    this.featherOutputFile = new File(App.Path.tempDir(), "111" + ".jpg"); 

    // Create the intent needed to start feather 
    Intent newIntent = new Intent(self, FeatherActivity.class); 

    // set the source image uri 
    newIntent.setData(uri); 

    // pass the required api key (http://developers.aviary.com/) 
    String API_KEY = "aaabbbccc"; 

    newIntent.putExtra("API_KEY", API_KEY); 

    // pass the uri of the destination image file (optional) 
    // This will be the same uri you will receive in the onActivityResult 
    newIntent.putExtra("output", Uri.parse("file://" + featherOutputFile.getAbsolutePath())); 

    // format of the destination image (optional) 
    newIntent.putExtra("output-format", Bitmap.CompressFormat.JPEG.name()); 

    // output format quality (optional) 
    newIntent.putExtra("output-quality", 100); 

    // you can force feather to display only a certain tools 
    // newIntent.putExtra("tools-list", new String[]{"ADJUST", "BRIGHTNESS" }); 

    // enable fast rendering preview 
    newIntent.putExtra("effect-enable-fast-preview", true); 

    // limit the image size 
    // You can pass the current display size as max image size because after 
    // the execution of Aviary you can save the HI-RES image so you don't need a big 
    // image for the preview 
    newIntent.putExtra("max-image-size", App.screenWidth); 
    newIntent.putExtra("effect-enable-external-pack", false); 
    newIntent.putExtra("stickers-enable-external-pack", false); 
    newIntent.putExtra("effect-enable-borders", false); 

    // HI-RES 
    // You need to generate a new session id key to pass to Aviary feather 
    // this is the key used to operate with the hi-res image (and must be unique for every new instance of Feather) 
    // The session-id key must be 64 char length 
    String mSessionId = StringUtils.getSha256(System.currentTimeMillis() + API_KEY); 
    newIntent.putExtra("output-hires-session-id", mSessionId); 

    // you want to hide the exit alert dialog shown when back is pressed 
    // without saving image first 
    // newIntent.putExtra("hide-exit-unsave-confirmation", true); 

    // ..and start feather 
    startActivityForResult(newIntent, INTENT_FEATHER); 
} 

가 난 아무것도 그리워 :

이 내 코드?

+0

고해상도 출력을 사용 했습니까? 작은 크기의 미리보기가 반환되는 것은 크기가 장치의 메모리에 따라 다릅니다. –

+0

도와 드릴까요? 하지만 다른 lib를 사용해야합니다. –

+0

@Freewind이 질문은 2 년 후에도 답변을 얻지 못했기 때문에 내가 묻는대로 죄송합니다. 해결책을 얻었습니까? 지금 같은 문제에 직면하고 있습니다. – Praveen

답변

1

마지막으로 해결책을 얻었습니다. Aviary 안드로이드 샘플 앱에 언급되어 있습니다

final DisplayMetrics metrics = new DisplayMetrics(); 
     getWindowManager().getDefaultDisplay().getMetrics(metrics); 
     int max_size = Math.max(metrics.widthPixels, metrics.heightPixels); 
     max_size = (int) ((float) max_size/1.2f); 
     newIntent.putExtra(Constants.EXTRA_MAX_IMAGE_SIZE, max_size); 
관련 문제