tom - Encoding buffer to webP: "input too large...
Encoding buffer to webP: "input too large" after Upload File Trigger
Solution:Jump to solution
hey @tom, the webp-converter package you were using in your code has been deprecated and seems to be broken. But luckily we can just use ffmpeg to do the conversion for us and BuildShip has this installed by default. I'm sharing with you a workflow that takes a file buffer and converts it to webp using ffmpeg and return the converted buffer. It then upload this buffer to BuildShip storage and returns the download URL. You can of course update it to return the buffer directly.
https://buildship.app/remix/62601e1e-dcb5-41ec-9c94-ceb41aa09a2c...
BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
9 Replies
I might be missing some principle aspect of Buildship. I'm using the Upload File trigger, after that a node which is supposed to encode it in webP:
Even with a filesize of 90KB, I'm getting an error of
Input too large
@tom The response from the logs - input&output is too large and is not an error or issue, we are excluding very large JSON responses in the logs system currently and displaying the above message, it should work correctly if you connect it with your client (frontend) and send the response. We'll update the limit and will improve the UX around this. You'll still be able to use the output in the next nodes.
@Gaurav Chadha thank you for a quick reply. I was hoping I can blame BuildShip for my incompetence π Then I'm failing for some other reason. Do you have any recommendations how to convert the images to webP? The AI suggest usings Jimp package, but it seems that there's some issue with it currently, also reported here: https://github.com/jimp-dev/jimp/issues/1350
GitHub
TypeError: Jimp.read is not a function Β· Issue #1350 Β· jimp-dev/jimp
I expect to be able to use the Jimp.read() function to load and manipulate images without encountering an error. The Jimp.read() function is throwing a Jimp.read is not a function error, and I'...
This is what I ended up using: https://pastecode.io/s/57oruy2o (can't paste here due to message size limit), but I'm running into issues creating the temp paths.
WebP conversion promise rejected: ENOENT: no such file or directory, open '/usr/src/app/bucket/builtNodes/temp/64baa5c7-7adb-451d-b2c2-f3476c4a0647.webp'
Is there some docs about how to create the temp paths and I'm just missing something obvious?cc @Luis can you help check this?
Sure thing
Solution
hey @tom, the webp-converter package you were using in your code has been deprecated and seems to be broken. But luckily we can just use ffmpeg to do the conversion for us and BuildShip has this installed by default. I'm sharing with you a workflow that takes a file buffer and converts it to webp using ffmpeg and return the converted buffer. It then upload this buffer to BuildShip storage and returns the download URL. You can of course update it to return the buffer directly.
https://buildship.app/remix/62601e1e-dcb5-41ec-9c94-ceb41aa09a2c
BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
@Gaurav Chadha , @Luis you my dear sirs are my heroes! Works perfectly and also gives me the chance to learn Buildship and JS/TS more learning the code you provided! Thank you so much!
Buildship earned a forever 10 on the NPS from me π€
Glad to hear that @tom π. We'll be around if you ever need more help in the future.