Hi,
What would be the best way to downsize images before storing it in the survey Json. Is there a hook to integrate any of the popular node image compression libraries?
Image compression and optimization
Show previous comments
(0)
Comments
(0)
Sign in to comment on this post
Answers approved by surveyjs Support
Hello,
To decrease the image size before saving it to a survey JSON, you can handle the creator.onUploadFile event handler, obtain uploaded files from options.files, compress them (using a required third-party library, for example), and send the options.callback('success', 'base64-compressed-image)
callback function.
The following demo shows an example of the creator.onUploadFile
function usage: Manage Image Uploads.
I hope this information helps. Please let us know if you have any questions or require further assistance.