From a29745571270935ac39da2ee9036d103b50f464c Mon Sep 17 00:00:00 2001 From: fereshtah Date: Mon, 10 May 2021 18:39:39 +0430 Subject: [PATCH 1/6] issue #717 (folder picker for save) solved. --- sample/src/main/AndroidManifest.xml | 2 + .../yalantis/ucrop/sample/ResultActivity.java | 37 ++++++++++++++++--- ucrop/build.gradle | 1 + 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 634aafa16..3687b8132 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -7,6 +8,7 @@ Date: Tue, 11 May 2021 21:45:38 +0430 Subject: [PATCH 2/6] fixing issue #716 (first try) --- .../yalantis/ucrop/util/BitmapLoadUtils.java | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java b/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java index 5e482f689..e5795b2d9 100755 --- a/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java @@ -53,20 +53,62 @@ public static Bitmap transformBitmap(@NonNull Bitmap bitmap, @NonNull Matrix tra return bitmap; } - public static int calculateInSampleSize(@NonNull BitmapFactory.Options options, int reqWidth, int reqHeight) { +// public static int calculateInSampleSize(@NonNull BitmapFactory.Options options, int reqWidth, int reqHeight) { +// // Raw height and width of image +// final int height = options.outHeight; +// final int width = options.outWidth; +// int inSampleSize = 1; +// +// if (height > reqHeight || width > reqWidth) { +// // Calculate the largest inSampleSize value that is a power of 2 and keeps both +// // height and width lower or equal to the requested height and width. +// while ((height / inSampleSize) > reqHeight || (width / inSampleSize) > reqWidth) { +// inSampleSize *= 2; +// } +// } +// return inSampleSize; +// } + public static int calculateInSampleSize(BitmapFactory.Options options, + int reqWidth, int reqHeight) { + // BEGIN_INCLUDE (calculate_sample_size) // Raw height and width of image final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { - // Calculate the largest inSampleSize value that is a power of 2 and keeps both - // height and width lower or equal to the requested height and width. - while ((height / inSampleSize) > reqHeight || (width / inSampleSize) > reqWidth) { + + final int halfHeight = height / 2; + final int halfWidth = width / 2; + + // Calculate the largest inSampleSize value that is a power of 2 and + // keeps both + // height and width larger than the requested height and width. + while ((halfHeight / inSampleSize) > reqHeight + && (halfWidth / inSampleSize) > reqWidth) { + inSampleSize *= 2; + } + + // This offers some additional logic in case the image has a strange + // aspect ratio. For example, a panorama may have a much larger + // width than height. In these cases the total pixels might still + // end up being too large to fit comfortably in memory, so we should + // be more aggressive with sample down the image (=larger + // inSampleSize). + + long totalPixels = width * height / inSampleSize; + + // Anything more than 2x the requested pixels we'll sample down + // further + final long totalReqPixelsCap = reqWidth * reqHeight * 2; + + while (totalPixels > totalReqPixelsCap) { inSampleSize *= 2; + totalPixels /= 2; } } return inSampleSize; + // END_INCLUDE (calculate_sample_size) } public static int getExifOrientation(@NonNull Context context, @NonNull Uri imageUri) { From b4455ebcad39958e85f30a63639e5514b8525ec2 Mon Sep 17 00:00:00 2001 From: fereshtah Date: Wed, 12 May 2021 13:33:29 +0430 Subject: [PATCH 3/6] issue 725 solved. --- .../main/java/com/yalantis/ucrop/UCrop.java | 22 ++++++++++++++----- .../yalantis/ucrop/util/BitmapLoadUtils.java | 21 +----------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java index e28fd5bc9..d35cb8261 100644 --- a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java @@ -10,6 +10,8 @@ import android.os.Build; import android.os.Bundle; import android.os.Parcelable; +import android.util.Log; +import android.widget.Toast; import com.yalantis.ucrop.model.AspectRatio; @@ -34,6 +36,7 @@ public class UCrop { public static final int REQUEST_CROP = 69; public static final int RESULT_ERROR = 96; public static final int MIN_SIZE = 10; + public static final int MAX_SIZE = 50; private static final String EXTRA_PREFIX = BuildConfig.APPLICATION_ID; @@ -102,12 +105,19 @@ public UCrop useSourceImageAspectRatio() { * @param height max cropped image height */ public UCrop withMaxResultSize(@IntRange(from = MIN_SIZE) int width, @IntRange(from = MIN_SIZE) int height) { - if (width < MIN_SIZE) { - width = MIN_SIZE; - } - - if (height < MIN_SIZE) { - height = MIN_SIZE; +// if (width < MIN_SIZE) { +// width = MIN_SIZE; +// } +// +// if (height < MIN_SIZE) { +// height = MIN_SIZE; +// } + if (width > MAX_SIZE) { + width = MAX_SIZE; + } + + if (height > MAX_SIZE) { + height = MAX_SIZE; } mCropOptionsBundle.putInt(EXTRA_MAX_SIZE_X, width); diff --git a/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java b/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java index e5795b2d9..703835e94 100755 --- a/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java @@ -70,36 +70,18 @@ public static Bitmap transformBitmap(@NonNull Bitmap bitmap, @NonNull Matrix tra // } public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { - // BEGIN_INCLUDE (calculate_sample_size) - // Raw height and width of image + final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; - if (height > reqHeight || width > reqWidth) { - final int halfHeight = height / 2; final int halfWidth = width / 2; - - // Calculate the largest inSampleSize value that is a power of 2 and - // keeps both - // height and width larger than the requested height and width. while ((halfHeight / inSampleSize) > reqHeight && (halfWidth / inSampleSize) > reqWidth) { inSampleSize *= 2; } - - // This offers some additional logic in case the image has a strange - // aspect ratio. For example, a panorama may have a much larger - // width than height. In these cases the total pixels might still - // end up being too large to fit comfortably in memory, so we should - // be more aggressive with sample down the image (=larger - // inSampleSize). - long totalPixels = width * height / inSampleSize; - - // Anything more than 2x the requested pixels we'll sample down - // further final long totalReqPixelsCap = reqWidth * reqHeight * 2; while (totalPixels > totalReqPixelsCap) { @@ -108,7 +90,6 @@ public static int calculateInSampleSize(BitmapFactory.Options options, } } return inSampleSize; - // END_INCLUDE (calculate_sample_size) } public static int getExifOrientation(@NonNull Context context, @NonNull Uri imageUri) { From 5308aff07ff026cbb005dd6a9f023139bea3cba8 Mon Sep 17 00:00:00 2001 From: fereshtah Date: Wed, 12 May 2021 14:06:52 +0430 Subject: [PATCH 4/6] issue #695 solved. --- .../com/yalantis/ucrop/sample/ResultActivity.java | 7 ++++++- .../com/yalantis/ucrop/sample/SampleActivity.java | 7 ++++++- .../yalantis/ucrop/sample/SavedUriSingleton.java | 15 +++++++++++++++ sample/src/main/res/layout/activity_result.xml | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 sample/src/main/java/com/yalantis/ucrop/sample/SavedUriSingleton.java diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/ResultActivity.java b/sample/src/main/java/com/yalantis/ucrop/sample/ResultActivity.java index e96e89e66..b2f4a5b09 100755 --- a/sample/src/main/java/com/yalantis/ucrop/sample/ResultActivity.java +++ b/sample/src/main/java/com/yalantis/ucrop/sample/ResultActivity.java @@ -27,6 +27,7 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.channels.FileChannel; +import java.time.Instant; import java.util.Calendar; import java.util.List; @@ -97,7 +98,11 @@ public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.menu_download) { saveCroppedImage(); } else if (item.getItemId() == android.R.id.home) { - onBackPressed(); + //onBackPressed(); + //Toast.makeText(ResultActivity.this, "Back", Toast.LENGTH_LONG).show(); + Intent sample_activity = new Intent(this, SampleActivity.class); + sample_activity.putExtra("back", true); + startActivity(sample_activity); } return super.onOptionsItemSelected(item); } diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java index 153937f8d..d20f1e5ae 100644 --- a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java +++ b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java @@ -81,7 +81,11 @@ public class SampleActivity extends BaseActivity implements UCropFragmentCallbac protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); + Boolean back = (Boolean)getIntent().getSerializableExtra("back"); setupUI(); + if (back != null){ + startCrop(SavedUriSingleton.getUri()); + } } @Override @@ -89,6 +93,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { if (requestCode == requestMode) { final Uri selectedUri = data.getData(); + SavedUriSingleton.setUri(selectedUri); if (selectedUri != null) { startCrop(selectedUri); } else { @@ -140,7 +145,7 @@ public void afterTextChanged(Editable s) { }; @SuppressWarnings("ConstantConditions") - private void setupUI() { + public void setupUI() { findViewById(R.id.button_crop).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/SavedUriSingleton.java b/sample/src/main/java/com/yalantis/ucrop/sample/SavedUriSingleton.java new file mode 100644 index 000000000..e470db4c1 --- /dev/null +++ b/sample/src/main/java/com/yalantis/ucrop/sample/SavedUriSingleton.java @@ -0,0 +1,15 @@ +package com.yalantis.ucrop.sample; + +import android.net.Uri; + +public class SavedUriSingleton { + private static Uri uri; + + public static void setUri(Uri uri) { + SavedUriSingleton.uri = uri; + } + + public static Uri getUri() { + return uri; + } +} diff --git a/sample/src/main/res/layout/activity_result.xml b/sample/src/main/res/layout/activity_result.xml index 27d854983..e37b94ffc 100755 --- a/sample/src/main/res/layout/activity_result.xml +++ b/sample/src/main/res/layout/activity_result.xml @@ -13,7 +13,7 @@ android:background="?colorAccent" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:title="@string/format_crop_result_d_d" - app:titleTextColor="@android:color/white"/> + app:titleTextColor="@android:color/white" /> Date: Sat, 15 May 2021 19:58:19 +0430 Subject: [PATCH 5/6] issue #578 solved. --- .../com/yalantis/ucrop/sample/SampleActivity.java | 12 +++++++++++- ucrop/src/main/java/com/yalantis/ucrop/UCrop.java | 6 ++++++ .../main/java/com/yalantis/ucrop/UCropActivity.java | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java index d20f1e5ae..5a467e3c5 100644 --- a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java +++ b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java @@ -1,5 +1,6 @@ package com.yalantis.ucrop.sample; +import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Intent; import android.graphics.Bitmap; @@ -83,11 +84,13 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_sample); Boolean back = (Boolean)getIntent().getSerializableExtra("back"); setupUI(); + if (back != null){ startCrop(SavedUriSingleton.getUri()); } } + @SuppressLint("MissingSuperCall") @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK) { @@ -301,7 +304,13 @@ private UCrop basisConfig(@NonNull UCrop uCrop) { */ private UCrop advancedConfig(@NonNull UCrop uCrop) { UCrop.Options options = new UCrop.Options(); - + switch (mRadioGroupAspectRatio.getCheckedRadioButtonId()) { + case R.id.radio_origin: + options.setRatioVisibility(true); + break; + default: + break; + } switch (mRadioGroupCompressionSettings.getCheckedRadioButtonId()) { case R.id.radio_png: options.setCompressionFormat(Bitmap.CompressFormat.PNG); @@ -316,6 +325,7 @@ private UCrop advancedConfig(@NonNull UCrop uCrop) { options.setHideBottomControls(mCheckBoxHideBottomControls.isChecked()); options.setFreeStyleCropEnabled(mCheckBoxFreeStyleCrop.isChecked()); + /* If you want to configure how gestures work for all UCropActivity tabs diff --git a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java index d35cb8261..87c6767dc 100644 --- a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java @@ -271,6 +271,7 @@ public static class Options { public static final String EXTRA_COMPRESSION_FORMAT_NAME = EXTRA_PREFIX + ".CompressionFormatName"; public static final String EXTRA_COMPRESSION_QUALITY = EXTRA_PREFIX + ".CompressionQuality"; + public static final String EXTRA_RATIO_VIS = EXTRA_PREFIX + ".RatioVis"; public static final String EXTRA_ALLOWED_GESTURES = EXTRA_PREFIX + ".AllowedGestures"; @@ -337,6 +338,11 @@ public void setCompressionQuality(@IntRange(from = 0) int compressQuality) { mOptionBundle.putInt(EXTRA_COMPRESSION_QUALITY, compressQuality); } + + public void setRatioVisibility(boolean x) { + mOptionBundle.putBoolean(EXTRA_RATIO_VIS, x); + } + /** * Choose what set of gestures will be enabled on each tab - if any. */ diff --git a/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java b/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java index 0b32aafe8..30fc2f104 100644 --- a/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java @@ -261,6 +261,9 @@ private void processOptions(@NonNull Intent intent) { int aspectRationSelectedByDefault = intent.getIntExtra(UCrop.Options.EXTRA_ASPECT_RATIO_SELECTED_BY_DEFAULT, 0); ArrayList aspectRatioList = intent.getParcelableArrayListExtra(UCrop.Options.EXTRA_ASPECT_RATIO_OPTIONS); + if (intent.getBooleanExtra(UCrop.Options.EXTRA_RATIO_VIS, false)) { + mWrapperStateAspectRatio.setVisibility(View.GONE); + } if (aspectRatioX > 0 && aspectRatioY > 0) { if (mWrapperStateAspectRatio != null) { From 214bee39d2c096b54d72a77441659a09584567f3 Mon Sep 17 00:00:00 2001 From: fereshtah Date: Sun, 16 May 2021 22:12:56 +0430 Subject: [PATCH 6/6] issue #707 solved.(19:6 option not available for long image) --- .../yalantis/ucrop/sample/SampleActivity.java | 30 +++++++++++++++++++ .../com/yalantis/ucrop/RatioSingleton.java | 23 ++++++++++++++ .../main/java/com/yalantis/ucrop/UCrop.java | 5 ++++ .../com/yalantis/ucrop/UCropActivity.java | 7 ++++- .../ucrop/view/TransformImageView.java | 2 ++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 ucrop/src/main/java/com/yalantis/ucrop/RatioSingleton.java diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java index 5a467e3c5..9750aebc5 100644 --- a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java +++ b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java @@ -4,6 +4,7 @@ import android.annotation.TargetApi; import android.content.Intent; import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.PorterDuff; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; @@ -26,12 +27,14 @@ import android.widget.TextView; import android.widget.Toast; +import com.yalantis.ucrop.RatioSingleton; import com.yalantis.ucrop.UCrop; import com.yalantis.ucrop.UCropActivity; import com.yalantis.ucrop.UCropFragment; import com.yalantis.ucrop.UCropFragmentCallback; import java.io.File; +import java.io.InputStream; import java.util.Locale; import java.util.Random; @@ -90,6 +93,31 @@ protected void onCreate(Bundle savedInstanceState) { } } +// private void getDropboxIMGSize(Uri uri){ +// BitmapFactory.Options options = new BitmapFactory.Options(); +// options.inJustDecodeBounds = true; +// BitmapFactory.decodeFile(new File(uri.getPath()).getAbsolutePath()); +// int imageHeight = options.outHeight; +// int imageWidth = options.outWidth; +// Toast.makeText(SampleActivity.this, String.valueOf(imageWidth), Toast.LENGTH_LONG).show(); +// +// } + + public void getImageSize(Uri uri){ + try { + BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + InputStream input = this.getContentResolver().openInputStream(uri); + BitmapFactory.decodeStream(input, null, options); input.close(); + //Toast.makeText(SampleActivity.this, String.valueOf(options.outHeight), Toast.LENGTH_LONG).show(); +// return new int[]{options.outWidth, options.outHeight}; + RatioSingleton.setX(options.outWidth); + RatioSingleton.setY(options.outHeight); + } + catch (Exception e){} +// return new int[]{0,0}; + } + @SuppressLint("MissingSuperCall") @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { @@ -97,6 +125,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == requestMode) { final Uri selectedUri = data.getData(); SavedUriSingleton.setUri(selectedUri); + getImageSize(selectedUri); if (selectedUri != null) { startCrop(selectedUri); } else { @@ -320,6 +349,7 @@ private UCrop advancedConfig(@NonNull UCrop uCrop) { options.setCompressionFormat(Bitmap.CompressFormat.JPEG); break; } + options.setImageX(RatioSingleton.getX()); options.setCompressionQuality(mSeekBarQuality.getProgress()); options.setHideBottomControls(mCheckBoxHideBottomControls.isChecked()); diff --git a/ucrop/src/main/java/com/yalantis/ucrop/RatioSingleton.java b/ucrop/src/main/java/com/yalantis/ucrop/RatioSingleton.java new file mode 100644 index 000000000..fd48b3a30 --- /dev/null +++ b/ucrop/src/main/java/com/yalantis/ucrop/RatioSingleton.java @@ -0,0 +1,23 @@ +package com.yalantis.ucrop; + +import android.net.Uri; + +public class RatioSingleton { + private static int x, y; + + public static int getX() { + return x; + } + + public static void setX(int x) { + RatioSingleton.x = x; + } + + public static int getY() { + return y; + } + + public static void setY(int y) { + RatioSingleton.y = y; + } +} diff --git a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java index 87c6767dc..906fdb1dd 100644 --- a/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/UCrop.java @@ -272,6 +272,7 @@ public static class Options { public static final String EXTRA_COMPRESSION_FORMAT_NAME = EXTRA_PREFIX + ".CompressionFormatName"; public static final String EXTRA_COMPRESSION_QUALITY = EXTRA_PREFIX + ".CompressionQuality"; public static final String EXTRA_RATIO_VIS = EXTRA_PREFIX + ".RatioVis"; + public static final String EXTRA_IMAGE_X = EXTRA_PREFIX + ".ImageX"; public static final String EXTRA_ALLOWED_GESTURES = EXTRA_PREFIX + ".AllowedGestures"; @@ -463,6 +464,10 @@ public void setToolbarColor(@ColorInt int color) { mOptionBundle.putInt(EXTRA_TOOL_BAR_COLOR, color); } + public void setImageX(int x) { + mOptionBundle.putInt(EXTRA_IMAGE_X, x); + } + /** * @param color - desired resolved color of the statusbar */ diff --git a/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java b/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java index 30fc2f104..d53a45f1e 100644 --- a/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java @@ -11,6 +11,7 @@ import android.os.Bundle; import android.text.TextUtils; import android.util.Log; +import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -24,6 +25,7 @@ import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; +import android.widget.Toast; import com.yalantis.ucrop.callback.BitmapCropCallback; import com.yalantis.ucrop.model.AspectRatio; @@ -448,7 +450,10 @@ private void setupAspectRatioWidget(@NonNull Intent intent) { aspectRatioList.add(new AspectRatio(getString(R.string.ucrop_label_original).toUpperCase(), CropImageView.SOURCE_IMAGE_ASPECT_RATIO, CropImageView.SOURCE_IMAGE_ASPECT_RATIO)); aspectRatioList.add(new AspectRatio(null, 3, 2)); - aspectRatioList.add(new AspectRatio(null, 16, 9)); + //Toast.makeText(this, mGestureCropImageView.toString(), Toast.LENGTH_LONG).show(); + if (intent.getIntExtra(UCrop.Options.EXTRA_IMAGE_X, 0) < 220) { + aspectRatioList.add(new AspectRatio(null, 16, 9)); + } } LinearLayout wrapperAspectRatioList = findViewById(R.id.layout_aspect_ratio); diff --git a/ucrop/src/main/java/com/yalantis/ucrop/view/TransformImageView.java b/ucrop/src/main/java/com/yalantis/ucrop/view/TransformImageView.java index 91d348b2f..aee7e24fc 100755 --- a/ucrop/src/main/java/com/yalantis/ucrop/view/TransformImageView.java +++ b/ucrop/src/main/java/com/yalantis/ucrop/view/TransformImageView.java @@ -9,6 +9,7 @@ import android.util.AttributeSet; import android.util.Log; +import com.yalantis.ucrop.RatioSingleton; import com.yalantis.ucrop.callback.BitmapLoadCallback; import com.yalantis.ucrop.model.ExifInfo; import com.yalantis.ucrop.util.BitmapLoadUtils; @@ -53,6 +54,7 @@ public class TransformImageView extends AppCompatImageView { private int mMaxBitmapSize = 0; private String mImageInputPath, mImageOutputPath; + public int x, y; private ExifInfo mExifInfo; /**