filestack / filestack-php

Official PHP SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
56 stars 32 forks source link

Filelink convertFile with option docinfo not working #49

Open aldoreyes opened 3 years ago

aldoreyes commented 3 years ago

Trying to get the numpages of a pdf file by using the following is not working.

$filelink->convertFile('jpg', ['docinfo' => TRUE]);

The response from this call returns this:

array:2 [
  "dimensions" => array:2 [
    "height" => 792
    "width" => 612
  ]
  "numpages" => 2
]

Since the response to these transform calls is handled in CommonMixin::handleResponseCreateFilelink

It tries to run the code and fails on this line $url = $json_response['url']; Since the response doesn't have a url property.

It doesn't seem that there is any code handling this kind of requests even when in the docs it mentions this option docinfo is available through this convertFile function.

Expected Result: It should handle the response and expose the result either as a property in FileLink or in a new class.

Edit: typos