falospecial.blogg.se

Javascript resize image base64
Javascript resize image base64












So I tried to the use the package react-image-file-resizer to resize dimensions & reduce size of images and the problem is when.

I am using an API to get images that have high resolutions & sizes, but when loading the images in the component it took time to load and even the CPU & HDD are used with high percentage when scrolling the list.

So I tried to the use the package react-image-file-resizer to resize dimensions & reduce size of images and the problem is when i want to get result as String to send it back to the component, I always get this Promise in the method imageFileResizeCompression below.įile : /** Convert an "Image URL" to a "Blob" type.Ĭonst convertImageURLToBlob = async (imageInputURL: string) => from '. Hello Community, I am here to ask for help. We will modify this code later to be a callable function so that the width is no longer hard-coded and the height can be set arbitrarily when users don't want to preserve the aspect ratio. I am using an API to get images that have high resolutions & sizes, but when loading the images in the component it took time to load and even the CPU & HDD are used with high percentage when scrolling the list. We can use the following JavaScript code to resize our image.














Javascript resize image base64