pqina / filepond-plugin-image-transform

🖼 Client-side image transformations for FilePond
https://pqina.nl/filepond
MIT License
18 stars 8 forks source link

Uncaught error for TIFF image files #17

Closed bagnus closed 4 years ago

bagnus commented 4 years ago

Hi, I have a web page where, after loading files with drag&drop (like in standard filepond examples) they are uploaded on a PHP server (using filepond uploader).

That works for all file types I have to use except for TIFF image files. In browser with TIFF support (ex: Safari in OSX) everything is ok, but in browsers whitout TIFF support (Ex: Firefox and Chrome on Mac or Win), after the loading I have a js crash with an uncaught error related to this promise at line 3710 on 3.7.2:

// add default output version if output default set to true or if no variants defined
          if (query('GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT')) {
            variants.push(function(transform, file, metadata) {
              return new Promise(function(resolve) {
                transform(file, metadata).then(function(file) {
                  return resolve({
                    name: query('GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME'),
                    file: file
                  });
                });
              });
            });
          }

I suppose that the promise lacks to check for error (not sure) and perhps the same issue can happens also in other promises of the module...

Of course I can't suppose to have thumbnail/preview for TIFF in browsers without TIFF support; I am thinking about inserting a dummy reject function in promise to skip error. Is it the good direction ?

Thanks

rikschennink commented 4 years ago

I'll run some tests later this week.

bagnus commented 4 years ago

OK. Here is the case summary.

1) load TIFF file with drag & drop : The file is always loaded. The image preview appears only with Safari (on Mac), but this is expected as other browsers lack native TIFF support.

2) start execute (upload) : On Safari on Mac uploading is OK and everything is fine. Other browsers hang with error. Seems a image animation issue.

3) errors :

Thanks for your help Andrea

rikschennink commented 4 years ago

Should be fixed in version 3.7.3 of the transform plugin. (the resize plugin has also been updated)

bagnus commented 4 years ago

Hi Rik, thanks for your help , your support is really impressive ! Greetings from Bologna, Italy Andrea