filestack/filestack-js

`doc_to_images` transform not supported by client

wayne530 opened this issue · 0 comments

The doc_to_images transform is part of the processing API, documented here:
https://www.filestack.com/docs/api/processing/#document-to-images

However, as of the time of this writing, the doc_to_images transform is not supported by the Javascript client, requiring hacks to manually construct the URL. Here is a reference to TransformOptions:

https://filestack.github.io/filestack-js/interfaces/transformoptions.html

where you can clearly see doc_to_images is not supported.

Additionally, the URLs returned by the doc_to_images operation do support additional transformations being applied. For example, if page 1 is https://cdn.filestackcontent.com/API_KEY/doc_to_images@1/HANDLE, additional transformations can be injected between doc_to_images@1 and HANDLE, for example:

https://cdn.filestackcontent.com/API_KEY/doc_to_images@1/rotate=deg:exif/imagesize/HANDLE

However, attempting to do either of the following fails:

(1) Use doc_to_images@1/HANDLE as the handle to the transform() method
(2) Use HANDLE as the handle to the transform() method and add { "doc_to_images@1": true } as the first transformation

The Javascript client should be able to properly support the processing API on the images generated by doc_to_images and/or the API should return dedicated handles for each of the extracted page images that would then be supported by the processing API.

Expected Behavior

Since it is part of the processing API, doc_to_images should be supported by official clients.

Current Behavior

It isn't supported.

Possible Solution

Construct a URL manually, which is error-prone and not future proof from URL changes.

Steps to Reproduce (for bugs)

https://jsfiddle.net/58b7jgxk/