tui.image-editor icon indicating copy to clipboard operation
tui.image-editor copied to clipboard

Image Metadata is lost after download modify image

Open lambamahesh opened this issue 2 years ago • 2 comments

@version 3.15.3

Development Environment

Core JavaScript

#Initialize Code

var imageEditor = new tui.ImageEditor('#tui-image-editor-container', { includeUI: { loadImage: { path: "{{ $content }}", // base64 data name: "{{ $type[0] ?? time() }}", // dynamic comming from server }, theme: blackTheme, menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'filter'], menuBarPosition: 'bottom', }, cssMaxWidth: 900, cssMaxHeight: 700, usageStatistics: false, });

lambamahesh avatar Sep 03 '22 10:09 lambamahesh

Your image is loaded into a canvas who does not preserve any metadata. The color profile and metadata will be lost. Be careful if your source image is not sRGB, the colors you will get back won't be the same.

You could use a lib like sharp js to extract and maybe inject again metadata.

I suggest that you read those SO answers : https://stackoverflow.com/questions/34027592/does-canvas-imagedata-in-javascript-contain-exif-info https://stackoverflow.com/questions/52495125/save-metadata-with-image-that-is-retrieved-from-html5-canvas

RKTZ avatar Sep 07 '22 23:09 RKTZ

@lambamahesh @RKTZ A good proposal. I agree with your proposal.

lja1018 avatar Sep 14 '22 05:09 lja1018