cordova-plugin-crop icon indicating copy to clipboard operation
cordova-plugin-crop copied to clipboard

Lock Square Aspect Ratio

Open vaibhavn1 opened this issue 9 years ago • 13 comments

Hi mate,

First of all i would like to thank you for the wonderful plugin. It has been a life saver for me.

I just needed to enquire that can we somehow lock the square aspect ratio of the crop window. As currently if we crop the picture it allows user to change the aspect ratio of crop window.

We are actually using only square photos in our application so to maintain the sanity of the pictures we want to lock the aspect ratio of the crop window

Any help will be greatly appreciated mate.

Regards Vaibhav

vaibhavn1 avatar Feb 26 '16 17:02 vaibhavn1

Android it is locked. But on iOS crop window is adjustable.

vaibhavn1 avatar Feb 26 '16 17:02 vaibhavn1

You can check PEPhotoCropEditor's docs and configure the source to do what you need. Here's the instantiation of that class https://github.com/jeduan/cordova-plugin-crop/blob/master/src/ios/CTCrop.m#L36-L44

jeduan avatar Feb 26 '16 18:02 jeduan

@vaibhavn1 Did you manage to do this? @jeduan Do you know how this can be done? Been trying to do it but just can't seem figure out what to change and how

Thanks

matte5031 avatar Jul 03 '16 16:07 matte5031

File CTCrop.m line 46 cropController.keepingCropAspectRatio = YES;

enraiser avatar Dec 24 '16 11:12 enraiser

This is resolved in #27

Try install the plugin with "cordova plugin add --save https://github.com/jeduan/cordova-plugin-crop", for get the master branch code.

renatobezerra avatar Jan 26 '17 15:01 renatobezerra

@jeduan Can we able to edit CTCrop.m, while I want crop seclection full image, instead of aspectRatio

divyasreekandalam avatar Apr 10 '17 11:04 divyasreekandalam

This issue doesn't seem to be fixed for me, on iOS the user is still able to adjust aspect ratio. Anyone else still having troubles here?

lukasstaecker avatar May 24 '17 14:05 lukasstaecker

See this fork https://github.com/obeza/cordova-plugin-crop-with-ratio by @obeza

John-Henrique avatar Oct 24 '17 17:10 John-Henrique

redefined width and height error how to solve this issue please give me solution

Sudarshan101 avatar Dec 14 '17 06:12 Sudarshan101

@John-Henrique If I install https://github.com/obeza/cordova-plugin-crop-with-ratio plugin using CLI it gives the error and closes the CLI.

I get the error as follows:

Failed to restore plugin "cordova-plugin-crop" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/obeza/cordova-plugin-crop-with-ratio.git via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL.

is there any solution for this?

Thanks, Haresh

hanatharesh2712 avatar Apr 04 '18 04:04 hanatharesh2712

I get the same error. I even used the --nofetch flag but I get the same error.

zougamohamed avatar Apr 07 '18 22:04 zougamohamed

Same error here, any news?

Alb93 avatar Aug 14 '18 21:08 Alb93

replace git+https with https in both config.xml and package.json this working for me

matteocusinato avatar Aug 30 '18 08:08 matteocusinato