Skip to content

crop() issue with 3.40.11 and newer (works in 3.40.10) #605

@dylanneild

Description

@dylanneild

We have a photo editing tool on a backend service that uses Filestack's crop() API.

Our custom tool stopped working in the on/around August 3rd. No code changes were made on our end and we can't find any issues on our end that would be causing the problem. We're using the standard 3.x.x SDK JS call from the Filestack delivery CDN, with the following code:

.picker({
    transformationsUI: false,
    transformations: {
        crop: true,
        circle: false,
        rotate: true
    },
    storeTo: {
        location: "s3"
    },
    maxFiles: 1,
    uploadInBackground: false,
    onClose: function(file) {
        if (self.receivedFile != null) {
            self.processEdit(root, id, photoNumber);
        }
    },
    onCancel: function() {
        self.receivedFile = null;
    },
    onFileUploadFinished: function(file) {
        self.receivedFile = file;
    },

}).crop([url]);

The url value is a URL on our CDN (backed by Cloudflare).

The error we're now experiencing is an "Image cannot be edited" problem in the Filestack UI when crop() is called:

Image

The JS console in the browser reports an error in the Filestack JS SDK, specifically that JSON.stringify cannot serialize cyclic structures.

I can also reproduce the issue with a simple crop() call in JS Fiddle using the examples linked to on the Filestack SDK development documentation.

Manually walking back to JS SDK 3.40.10 resolves the issue, so this problem was introduced as of SDK 3.40.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions