84
Views
4
Comments
Solved
[Cropper Library] Can't set options
Question
Forge component by Labs
5
Published on 02 Oct 2019

Hi,

If I add any options I have an error when calling the cropper

JSON Parse error: Expected '}'




Even if I put "{aspectRatio: 1}" in Options...

What is a proper syntax for this?


PS: I use it in v10 mobile app with phone theme.


Thank you,

Nick



Staff
Rank: #17
Solution

Hi Mykola,

Have you tried like this:  "{"viewMode":3,"aspectRatio":"1/1"}"   ?
Try it on an online json formatter and validator.

Regards

Hi Franisco,

Yes it works with double-double-quotes as it is a an expression field: 

"{""aspectRatio"":1,""viewMode"":1, ""scalable"":false}"

Thanks 

Rank: #1141

Hi,

How to fix the fixed cropboxwidth & height,(not max & min size)

Rank: #488

Hi,

We're having some problems setting the initial size of the cropper guides.

What is the correct syntax of adding this setting on the Options input parameter?

We've tried something like:


""ready"": function () {
$toCrop.cropper(""setCropBoxData"", { width: 50, height: 50 });
}


but we're getting an error from the JSON parser.

How can we workaround this issue?

Thank you very much in advance.

Best regards,

Paulo