cyrillef / forge.model.derivative-js

Asynchronous Javascript/Node.js library for the Autodesk Forge Model Derivative API
MIT License
2 stars 2 forks source link

GetThumbnail not working... #4

Open ishida328 opened 7 years ago

ishida328 commented 7 years ago

When getThumneil (Binary) with the Request module, It's required set "Encoding: null" paramater, but it can not be specified.

I changed the ApiClient.js,DerivativesApi.js.

############## ############## ApiClient.js #367 if(queryParams.isBinary && queryParams.isBinary==true) { requestParams.encoding=null; }

DerivativesApi.js #462 var queryParams = { 'width': opts['width'], 'height': opts['height'], 'isBinary' : opts["isBinary"] };

https://www.npmjs.com/package/request Note: if you expect binary data, you should set encoding: null.)

adamenagy commented 7 years ago

Thanks for the note. Yes, that is the workaround for the time being. It seems this fix did not make it into the package: https://github.com/Autodesk-Forge/forge.model.derivative-js There is now a new package replacing these, but the samples are not migrated to using them just yet. Not sure if the new npm package has the exact same issue: https://github.com/Autodesk-Forge/forge-api-nodejs-client

ishida328 commented 7 years ago

Thanks for your reply. It seemed to have been fixed. https://github.com/Autodesk-Forge/forge-api-nodejs-client/blob/master/src/ApiClient.js

336 - 339