CreativeSDK / phonegap-plugin-csdk-image-editor

A PhoneGap plugin for the Creative SDK Image Editor.
Apache License 2.0
35 stars 15 forks source link

Is there any way to fix the tools? #25

Open Netpolice opened 7 years ago

Netpolice commented 7 years ago

Is there any way to fix the tools?

e.g. Only allow crop in 4:3 ratio Only allow adjust the brightness Only allow draw a line

macdonst commented 7 years ago

@Netpolice yeah, you just have to pass in the options:

https://github.com/CreativeSDK/phonegap-plugin-csdk-image-editor/blob/master/docs/api.md

        var options = {
            outputType: CSDKImageEditor.OutputType.JPEG,
            tools: [
                // specify the tools you want
            ],
            crop: {
               // specify crop options
            },
            quality: 50
        };

        CSDKImageEditor.edit(success, error, imageUrl, options);
Netpolice commented 7 years ago

crop: { // specify crop options },

If I would like to fix the crop ratio at 4:3, then how do I do? I don't see there is tutorials in the document.

Thank you very much.

krish-dev commented 7 years ago

I have checked the source for customizing crop options. its like.

@property {boolean} [crop.custom=true] - [iOS only] Show custom option in crop tool

but it's only for iOS. then How it will works on Android?

pkudalkar7 commented 6 years ago

@macdonst , can we use custom stickers? var options = { outputType: CSDKImageEditor.OutputType.JPEG, tools: [ CSDKImageEditor.ToolType.ENHANCE, CSDKImageEditor.ToolType.EFFECTS, CSDKImageEditor.ToolType.ADJUST, CSDKImageEditor.ToolType.STICKERS, CSDKImageEditor.ToolType.Orientation, CSDKImageEditor.ToolType.CROP, CSDKImageEditor.ToolType.RESIZE, CSDKImageEditor.ToolType.SHARPNESS, CSDKImageEditor.ToolType.FOCUS, CSDKImageEditor.ToolType.TEXT ], STICKERS:{

               },
                 quality: 50
    };

Please help me how to add them , is it the right way above ?