I'm working with the Image Editor Component in my React application and I'm utilizing the saved prop to receive the file name and type after saving. However, I need to access additional information about the saved file and perform some manipulations or further processing on it
e handleImageSave
function, I'm currently receiving the file name and type. However, I need to extract the image file or perform additional operations on final edited file (saved file). How can I access additional file metadata or perform manipulations on the saved file using the ImageEditorComponent
?
<ImageEditorComponent
src={imageUrl}
ref={imgObj}
style={{ height: "100%", width: "100%" }}
edited={editedImageUrl}
imageEdit={(editedImage) => handleImageEdit(editedImage)}
created={(args)=>imageEditorCreated(args)}
imageSave={handleImageSave}
saved={(args) => handleImageSave(args)}
saved={handleSaveButtonClick} />
By using the getImageData method of the ImageEditor, you can retrieve the image data, and using an external canvas, you can convert the image data into Base64, which can then be loaded into the image editor or used for future purposes. Please refer to the code snippet and sample below.
[Sample link][https://stackblitz.com/edit/react-rnyjtm-fmjxn6?file=index.js]