Our great sponsors
-
sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I'm trying to process an image through the sharp module before sending it back to the front-end. But I'd also like to run it through a Base64 encoding. To achieve that, I need the image as buffer data. The module I'm using has a function for that as well. It is an asynchronous one and those are definitely my weaknesses. I wait for it to complete through the .then() statement and I simply encode it. I can safely say that this part is done. But for some reason, no matter what, res.end() always returns nothing. It's empty. It doesn't matter what value is in there. It just refuses to take one and return it to the front-end. The request may be over but the needed information is not there.