Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small image can't scale #3

Closed
AnswerZhao opened this issue Apr 13, 2017 · 10 comments
Closed

Small image can't scale #3

AnswerZhao opened this issue Apr 13, 2017 · 10 comments

Comments

@AnswerZhao
Copy link

When the loaded photo is too small , the image can't scale by touching.

@vellrya
Copy link
Contributor

vellrya commented Apr 13, 2017

I confirm.
Video: http://dropmefiles.com/UEQjI
Scale and translation gesture are activated.

@polyak01
Copy link
Contributor

app:ci_max_scale="1f"

cropView.configureImage()
  .setMinScale(minScale)
  .setMaxScale(maxScale)
  .apply();

Try to decrease minScale / increase maxScale

@AnswerZhao
Copy link
Author

@polyak01 It can't works.

@polyak01
Copy link
Contributor

polyak01 commented Apr 13, 2017

@AnswerZhao do you try to setMinScale(0.1f)?

@AnswerZhao
Copy link
Author

@polyak01
float scaleFactor = detector.getScaleFactor(); float newScale = matrixUtils.getScaleX(imageMatrix) * scaleFactor;
When the photo is too small, the newScale value is too lager than the maxScale.(70*70Px, the newScale is 25), so i think the scale value is not perfect. I change the method isValidScal() to resolve it finally.

@vellrya
Copy link
Contributor

vellrya commented Apr 13, 2017

@polyak01
I set MaxScale to 9f (minimum value at which it start working with my (409*103) picture) and MinScale to 0f.
It works, but it works strange. Until I set the frame with the same aspect ratio as the picture itself, I can not reduce the image. In addition, scale gestures work only outside the crop area.
(Video: http://dropmefiles.com/DbG2d)

@AnswerZhao
Copy link
Author

@vellrya 9 is not work for everything, you can try a 43*43 picture.

@vellrya
Copy link
Contributor

vellrya commented Apr 14, 2017

Okay. I decided for myself this problem. I completely removed Min and Maxscale and did this:

cropView.configureOverlay()
                .setAspectRatio(AspectRatio.IMG_SRC)
                .apply()

Now I can correctly move and scale small pictures. (http://dropmefiles.com/KQByj)
It remains only to wait for the ability to rotate pictures in this library)

@polyak01
Copy link
Contributor

@AnswerZhao Did you solved the problem?

@AnswerZhao
Copy link
Author

@polyak01 Yep. You can change the implement of the method isValidScal() ,or increase the maxScale, or remove the limits of maxScale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants