question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onFileCropped not working in the pickerOptions

See original GitHub issue

I got an error " Uncaught Error: Invalid picker params" when I added onFileCropped option. Here is my react code snippet.

<PickerOverlay
            apikey={FILESTACK_API_KEY}
            pickerOptions={{
              accept: ['image/*', 'image/jpeg'],
              exposeOriginalFile: true,
              imageMax: imageMax || undefined,
              imageMin: imageMin || undefined,
              onFileCropped: checkImageSize,
              onFileSelected: checkImageSize,
              onFileUploadStarted: () => {},
              onFileUploadFinished: () => {},
              onFileUploadFailed: () => { },
              onClose: () => {}
            }}
            onSuccess={(res) => { }}
          />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pcholujcommented, Mar 9, 2021

It should working in new release please check https://jsfiddle.net/pcholuj/54qhx8tL/2/

0reactions
mrshahrukh123commented, Jan 26, 2021

Hi @maryfs I am using jspicker for web

included following file.

//static.filestackapi.com/filestack-js/3.x.x/filestack.min.js

I tried to change this //static.filestackapi.com/filestack-js/3.21.0/filestack.min.js

my options are

  `const options = {
          exposeOriginalFile: true,
          // errorsTimeout:1000,
          onUploadDone: updateForm,
          onFileSelected: validateFile,
          onFileCropped: validateFile,
          accept: ["image/jpeg", "image/png", "application/pdf"],
          fromSources: ["local_file_system", "instagram", "facebook"],
          uploadInBackground: false,
  
          transformations: {
              circle: false,
              rotate: true,
          },
          maxSize: 10485760, //Should limit to 10MB`

When I remove the onFileCropped option with callback it worked fine, but with the onFileCropped its not working.

please also note that I am adding other options after clicking a button.

options["transformations"]["crop"] = { aspectRatio: for_width / for_height, force: true, }; client.picker(options).open();

can you please tell me is there anything I need to do to make this working ? its showing me the error ‘Uncaught Error: Invalid picker params’

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

`onFileCropped` callback throws an error · Issue #363 · filestack ...
Hello, when adding a onFileCropped callback to the Picker options, I get a Uncaught Error: Invalid picker params error. Every other callback (onFileSelected ......
Read more >
PickerOptions | filestack-js
Default is active only on local file source. ... The output will not be exactly 800x600 unless the imageMax matches the aspect ......
Read more >
pickerOptions: Options for 'pickerInput' in shinyWidgets - Rdrr.io
The function must return a string. Type: string | function; Default: function. The text on the button that deselects all options when actionsBox...
Read more >
filestack-js/CHANGELOG.md - UNPKG
20, * **picker:** Add onFileCropped callback ... 30, * **file_tools:** Fix problems with uploading large files ...
Read more >
filestack-js | Yarn - Package Manager
picker: Fix picker problems with cropFiles, erorrHandlers, add better mime detection (9dbe806); pickerOptions: add support email to picker options (09d40b0) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found