Giter VIP home page Giter VIP logo

toast-ui.react-image-editor's Introduction

⚠️Notice: This repository is deprecated️️️️️

TOAST UI ImageEditor React Wrapper has been managed separately from the TOAST UI ImageEditor repository. As a result of the distribution of these issues, we decided to deprecate each wrapper repository and manage repository as a mono-repo from the TOAST UI ImageEditor repository.

From now on, please submit issues or contributing related to TOAST UI React Wrapper to TOAST UI ImageEditor repository. Thank you🙂.

TOAST UI Image Editor for React

This is a React component wrapping TOAST UI Image Editor.

github version npm version license PRs welcome code with hearth by NHN

🚩 Table of Contents

Collect statistics on the use of open source

React Wrapper of TOAST UI Image Editor applies Google Analytics (GA) to collect statistics on the use of open source, in order to identify how widely TOAST UI Image Editor is used throughout the world. It also serves as important index to determine the future course of projects. location.hostname (e.g. > “ui.toast.com") is to be collected and the sole purpose is nothing but to measure statistics on the usage. To disable GA, use the usageStatistics props like the example below.

<ImageEditor
  usageStatistics={false}
/>

Or, include tui-code-snippet.js (v1.4.0 or later) and then immediately write the options as follows:

tui.usageStatistics = false;

💾 Install

Using npm

npm install --save @toast-ui/react-image-editor

📊 Usage

Import

You can use Toast UI Image Editor for React as a ECMAScript module or a CommonJS module. As this module does not contain CSS files, you should import tui-image-editor.css from tui-image-editor/dist manually.

  • Using ECMAScript module
import 'tui-image-editor/dist/tui-image-editor.css'
import ImageEditor from '@toast-ui/react-image-editor'
  • Using CommonJS module
require('tui-image-editor/dist/tui-image-editor.css');
var ImageEditor = require('@toast-ui/react-image-editor');

Props

All the options of the TOAST UI Image Editor are supported in the form of props.

const myTheme = {
  // Theme object to extends default dark theme.
};

const MyComponent = () => (
  <ImageEditor
    includeUI={{
      loadImage: {
        path: 'img/sampleImage.jpg',
        name: 'SampleImage'
      },
      theme: myTheme,
      menu: ['shape', 'filter'],
      initMenu: 'filter',
      uiSize: {
        width: '1000px',
        height: '700px'
      },
      menuBarPosition: 'bottom'
    }}
    cssMaxHeight={500}
    cssMaxWidth={700}
    selectionStyle={{
      cornerSize: 20,
      rotatingPointOffset: 70
    }}
    usageStatistics={true}
  />
);

Theme

Importing black/white-theme.js file is not working directly import yet. You want to use white theme, please write own theme object by copy and paste.

Instance Methods

For using instance methods of TOAST UI Image Editor, first thing to do is creating Refs of wrapper component using createRef(). But the wrapper component does not provide a way to call instance methods of TOAST UI Image Editor directly. Instead, you can call getInstance() method of the wrapper component to get the instance, and call the methods on it.

const imageEditorOptions = {
  // sort of option properties.
};

class MyComponent extends React.Component {
  editorRef = React.createRef();
  
  handleClickButton = () => {
    const editorInstance = this.editorRef.current.getInstance();

    editorInstance.flipX();
  };

  render() {
    return (
      <>
        <ImageEditor 
          ref={this.editorRef}
          {...imageEditorOptions}
        />
        <button onClick={this.handleClickButton}>Flip image by X Axis!</button>
      </>
    );
  }
}

Getting the root element

An instance of the wrapper component also provides a handy method for getting the root element. If you want to manipulate the root element directly, you can call getRootElement to get the element.

class MyComponent extends React.Component {
  editorRef = React.createRef();
  
  handleClickButton = () => {
    this.editorRef.current.getRootElement().classList.add('image-editor-root');
  };

  render() {
    return (
      <>
        <ImageEditor 
          ref={this.editorRef}
          {...imageEditorOptions} 
        />
        <button onClick={this.handleClickButton}>Click!</button>
      </>
    );
  }
}

Event

All the events of TOAST UI Image Editor are supported in the form of on[EventName] props. The first letter of each event name should be capitalized. For example, for using mousedown event you can use onMousedown prop like the example below.

class MyComponent extends React.Component {
  handleMousedown = () => {
    console.log('Mouse button is downed!');
  };

  render() {
    return (
      <ImageEditor 
        onMousedown={this.handleMousedown}
      />
    );
  }
}

🔧 Pull Request Steps

TOAST UI products are open source, so you can create a pull request(PR) after you fix issues. Run npm scripts and develop yourself with the following process.

Setup

Fork develop branch into your personal repository. Clone it to local computer. Install node modules. Before starting development, you should check to haveany errors.

$ git clone https://github.com/{your-personal-repo}/[[repo name]].git
$ cd [[repo name]]
$ npm install

Develop

Let's start development!

Pull Request

Before PR, check to test lastly and then check any errors. If it has no error, commit and then push it!

For more information on PR's step, please see links of Contributing section.

📙 Documents

💬 Contributing

📜 License

This software is licensed under the MIT © NHN.

toast-ui.react-image-editor's People

Contributors

jinwoo-kim-nhn avatar junghwan-park avatar lja1018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toast-ui.react-image-editor's Issues

addShape method not available (old version of tui-image-editor)

Version

latest version

Development Environment

React and Electron app

Current Behavior

The addShape method is not available because toast-ui.react-image-editor is using an old version of tui-image-editor (3.8.0). v3.10 includes the addShape method.

The following code does not work:

const instance = editorRef.current.getInstance()
instance.addShape('rect', {
			fill: '#ff0000',
			stroke: '#ff0000',
			strokeWidth: 0,
			top: 200,
			left: 300,
			rx: 80,
			ry: 80,
			isRegular: true
		})

Expected Behavior

Be able to call addShape in toast-ui.react-image-editor successfully.

Range/Slider not working

Version

1.3.0

Test Environment

Chrome, IOS, React App

Current Behavior

Using the sample code provided in the Readme file. Cannot use the slider properly. Below is the screen shot where the brightness Range/Slider goes beyond the limit. Same issue with all Range components

image

Expected Behavior

Slider/Range run as expected

Can only addImageObject after an image has been manually loaded.

Describe the bug
Been wracking my brain trying to find the bug in my implementation but it looks like ImageEditorInstance.addImageObject will only work after the editor has been initialized with another image. Might just need to add an initialization check on addImageObject? I'm not super familiar with this library just yet but I think that could work.

To Reproduce
Steps to reproduce the behavior:

  1. Setup basic functionality but do not load an image into the editor
  2. From the instance try to us method addImageObject with a URL (What I'm doing)
  3. Nothing happens but console logs show it's being added properly to the canvas (id is assigned and image attributes loaded) https://i.imgur.com/LPR7VPY.png
  4. Load image from filesystem like normal
  5. Try to addImageObject via url again
  6. Success! new printout has slightly different props showing https://i.imgur.com/e5kpYBw.png

Expected behavior
addImageObject adds image to the canvas

Screenshots
Image not showing - https://i.imgur.com/LPR7VPY.png
Image is showing - https://i.imgur.com/e5kpYBw.png
Code - https://i.imgur.com/jvZxIB5.png
In the last image you can see I'm trying to manually set the position but it doesn't reflect in image 1

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 81.0.2

Additional context
I hope this helps get this figured out! I've seen a few people complain about addImageObject not working while doing some research and their main issues could just be the order they're doing things in.

Typescript support

Version

^1.0.0

Test Environment

Brave, mac OSX 10.14.1

Current Behavior

No types file present in repo. Or in @types repo. Cannot use library in TypeScript project.

import ImageEditor from '@toast-ui/react-image-editor' // Could not find a declaration file for module '@toast-ui/react-image-editor'

import ImageEditor = require('tui-image-editor'); // import =` is not supported by @babel/plugin-transform-typescript Please consider using `import <moduleName> from '<moduleName>';` alongside Typescript's --allowSyntheticDefaultImports option.

Expected Behavior

Be able to use library in TypeScript project.

Error while testing with jest

Version

This is the line from my package.json:
"@toast-ui/react-image-editor": "^1.0.0"

Test Environment

Firefox, Pop_OS 18.04
Node: v10.16.0.

Current Behaviour:

The code is working fine in the brower, but when I try to do snapshot test of the component with ImageLoader in it, I get the following error:

FAIL src/views/Explorer/RemoteExplorerLayout/RemoteExplorerLayout.test.js
● Test suite failed to run

TypeError: Cannot read property 'createClass' of undefined

   7 | import 'tui-image-editor/dist/tui-image-editor.css'
   8 | 
>  9 | import ImageEditor from '@toast-ui/react-image-editor'
     | ^
  10 | 
  11 | function ImageLoader({downloadURL, inViewport, imageData, downloadImage, currentPath}) {
  12 | 

  at Object.<anonymous> (node_modules/tui-image-editor/dist/tui-image-editor.js:12869:39)

Component:

const myTheme = {
            // Theme object to extends default dark theme.
        };
        const MyComponent = () => (
            <ImageEditor
                includeUI={{
                    loadImage: {
                        path: imageData.data,
                        name: 'SampleImage'
                    },
                    theme: myTheme,
                    menu: ['shape', 'filter', 'crop'],
                    initMenu: 'filter',
                    uiSize: {
                        width: '80vw',
                        height: '90vh'
                    },
                    menuBarPosition: 'bottom',
                }}
                cssMaxHeight={500}
                cssMaxWidth={700}
                selectionStyle={{
                    cornerSize: 20,
                    rotatingPointOffset: 70
                }}
                usageStatistics={false}
            />
        );

How to get all filters and modifications applied to an image

How can I get all applied filters (for Grayscale, Sharpen) along with Crop settings and other settings, that has been applied to image?

Use scenario is that I need to save them (properties / changes being applied to image) to backend, so the end user that works on small thumbnail configures its image, but then only I can reproduce the same result (using somehow exported settings [filters etc.]), but using original, big res image.

How can we resize <ImageEditor> if the window changes of size ?

How can we resize <ImageEditor> if the window changes of size ?

Is there a smart way to do it ?

For the moment changing dynamically uiSize and cssMaxHeight and cssMaxWidth doesn't work on window.resize

For example i want <ImageEditor> size to change if an Ipad flips from lanscape to potrait window size.
Other example: my users use an Electron app and sometimes change Window Size

Thanks a lot for your help !

Error when building on server - Uncaught TypeError: Super expression must either be null or a function

Version

@toast-ui/[email protected]

Test Environment

  • Google Chrome v89.0.4389.90
  • MacOS v11.2.3
  • Node v11.1.0
  • NPM v6.4.1

Current Behavior

The code works fine when running locally, but after building on my server ( Amazon Linux 2 ), I'm seeing the following error..

Uncaught TypeError: Super expression must either be null or a function

Removing ImageEditor and rebuilding solves the issue, so I'm not exactly sure what is causing this from the module.

<ImageEditor
    ref={this.imageEditorRef}
    includeUI={{
        loadImage: {
            path: photo.fullPath,
            name: photo.name
        },
        menu: ['draw'],
        initMenu: 'draw',
        uiSize: {
            width: '1000px',
            height: '715px',
        },
        menuBarPosition: 'bottom',
    }}
    cssMaxHeight={800}
    cssMaxWidth={800}
    selectionStyle={{
        cornerSize: 20,
        rotatingPointOffset: 70,
    }}

/>

Expected Behavior

Building on the server should allow the webapp and ImageEditor to behave as expected.

get error when run the code step by step from readme.

Version

"@toast-ui/react-image-editor": "^1.0.0"

Test Environment

windows 7

Current Behavior

run the code step by step from the repo's readme file got the following error:
Failed to compile
./node_modules/tui-image-editor/dist/tui-image-editor.js
Module not found: Can't resolve 'fabric/dist/fabric.require' in 'C:\sf\react-app\node_modules\tui-image-editor\dist'
This error occurred during the build time and cannot be dismissed.

import React from 'react'
import 'tui-image-editor/dist/tui-image-editor.css'
import ImageEditor from '@toast-ui/react-image-editor'

const myTheme = {
  // Theme object to extends default dark theme.
};

const MyImageEditor = () => (
  <ImageEditor
    includeUI={{
      loadImage: {
        path: 'img/sampleImage.jpg',
        name: 'SampleImage'
      },
      theme: myTheme,
      menu: ['shape', 'filter'],
      initMenu: 'filter',
      uiSize: {
        width: '1000px',
        height: '700px'
      },
      menuBarPosition: 'bottom'
    }}
    cssMaxHeight={500}
    cssMaxWidth={700}
    selectionStyle={{
      cornerSize: 20,
      rotatingPointOffset: 70
    }}
    usageStatistics={true}
  />
);

export default MyImageEditor;

Expected Behavior

show the image editor in the page.

Load secondary Image over canvas

Hi, I hope you are doing good. Is there a way We can load secondary image over our main canvas image in tui-image-editor. Can you guide me on how to do that, It will help me a lot. Thanks

Uncaught TypeError : o.a.createRef is not a function

Version

"@toast-ui/react-image-editor": "^1.0.1",

Test Environment

Chrome , firefox , etc

Current Behavior

I installed the package and tried to run it but it is giving me error
Uncaught TypeError : o.a.createRef is not a function
my react version is 15.5.4

// Write example code

Expected Behavior

Icons don't showing

Version

"@toast-ui/react-image-editor": "^1.0.1"

Test Environment

Chrome, macOS Mojave

Current Behavior

Icons don't showing

import 'tui-image-editor/dist/tui-image-editor.css';
import ImageEditor from '@toast-ui/react-image-editor';
                      <ImageEditor
                            includeUI={{
                            loadImage: {
                              path: ""
                              name: 'SampleImage',
                            },
                            menu: ['shape', 'filter'],
                            initMenu: 'filter',
                            uiSize: {
                              width: '1000px',
                              height: '700px',
                            },
                            menuBarPosition: 'bottom',
                          }}
                          cssMaxHeight={500}
                          cssMaxWidth={700}
                          selectionStyle={{
                            cornerSize: 20,
                            rotatingPointOffset: 70,
                          }}
                          usageStatistics
                        />

Ekran Resmi 2019-07-17 11 07 04

throw TypeError Error when clicking delete btn(when nothing is selected)

Version

^3.9.0

Test Environment

chrome 83.0.4103.97

Current Behavior

everything works fine but it will throw an error when click delete btn

TypeError: Cannot read property 'type' of undefined
at Graphics.getActiveObjectIdForRemove (VM48076 graphics.js:447)
at ImageEditor.removeActiveObject (VM47973 imageEditor.js:417)
at Object._delete [as delete] (VM48074 action.js:107)
at HTMLLIElement._this3.eventHandler. (VM48044 ui.js:476)

<TuiImageEditor {...props} />
// Write example code

Expected Behavior

no errors (or just get delete btn disabled)

ReferenceError: window is not defined

We are trying to use this module with our React SSR (Server Side Rendering) project and its keep giving us below error.

ReferenceError: window is not defined
at Object.<anonymous> (/var/www/app/node_modules/tui-image-editor/dist/tui-image-editor.js:16:4)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module._compile (/var/www/app/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.newLoader [as .js] (/var/www/apcrat/admin/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)

We have tried different solutions suggested online by setting window as global or conditioning in componentDidMount life cycle method but non of them working.

Is there any work around for this ?

SVG icons are not displayed on the editor

Version

"@toast-ui/react-image-editor": "^1.0.1"

Test Environment

Windows10, Chrome

Current Behavior

I created a basic implementation of the TOAT UI using React.js however I am facing an issue with the svg icons which are not displayed somehow.

import React from 'react';
import 'tui-image-editor/dist/tui-image-editor.css'
import 'tui-image-editor/dist/svg/icon-a.svg';
import 'tui-image-editor/dist/svg/icon-b.svg';
import 'tui-image-editor/dist/svg/icon-c.svg';
import 'tui-image-editor/dist/svg/icon-d.svg';
import ImageEditor from '@toast-ui/react-image-editor';


var customTheme = {
  'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',
  'common.bisize.width': '251px',
  'common.bisize.height': '21px',
  'common.backgroundImage': 'none',
  'common.backgroundColor': '#1e1e1e',
  'common.border': '0px',
  
  // header
  'header.backgroundImage': 'none',
  'header.backgroundColor': 'transparent',
  'header.border': '0px',
  
  // load button
  'loadButton.backgroundColor': '#fff',
  'loadButton.border': '1px solid #ddd',
  'loadButton.color': '#222',
  'loadButton.fontFamily': 'NotoSans, sans-serif',
  'loadButton.fontSize': '12px',
  
  // download button
  'downloadButton.backgroundColor': '#fdba3b',
  'downloadButton.border': '1px solid #fdba3b',
  'downloadButton.color': '#fff',
  'downloadButton.fontFamily': 'NotoSans, sans-serif',
  'downloadButton.fontSize': '12px',
  
  // main icons
  'menu.normalIcon.path': '../dist/svg/icon-b.svg',
  'menu.normalIcon.name': 'icon-b',
  'menu.activeIcon.path': '../dist/svg/icon-a.svg',
  'menu.activeIcon.name': 'icon-a',
  'menu.iconSize.width': '24px',
  'menu.iconSize.height': '24px',
  
  // submenu primary color
  'submenu.backgroundColor': '#1e1e1e',
  'submenu.partition.color': '#858585',
  
  // submenu icons
  'submenu.normalIcon.path': '../dist/svg/icon-a.svg',
  'submenu.normalIcon.name': 'icon-a',
  'submenu.activeIcon.path': '../dist/svg/icon-c.svg',
  'submenu.activeIcon.name': 'icon-c',
  'submenu.iconSize.width': '32px',
  'submenu.iconSize.height': '32px',
  
  // submenu labels
  'submenu.normalLabel.color': '#858585',
  'submenu.normalLabel.fontWeight': 'lighter',
  'submenu.activeLabel.color': '#fff',
  'submenu.activeLabel.fontWeight': 'lighter',
  
  // checkbox style
  'checkbox.border': '1px solid #ccc',
  'checkbox.backgroundColor': '#fff',
  
  // rango style
  'range.pointer.color': '#fff',
  'range.bar.color': '#666',
  'range.subbar.color': '#d1d1d1',
  'range.value.color': '#fff',
  'range.value.fontWeight': 'lighter',
  'range.value.fontSize': '11px',
  'range.value.border': '1px solid #353535',
  'range.value.backgroundColor': '#151515',
  'range.title.color': '#fff',
  'range.title.fontWeight': 'lighter',
  
  // colorpicker style
  'colorpicker.button.border': '1px solid #1e1e1e',
  'colorpicker.title.color': '#fff'
  };

const PaintingForm = () => (
  <ImageEditor
    includeUI={{
      loadImage: {
        path: 'img/sampleImage.jpg',
        name: 'SampleImage',
      },
      theme: customTheme,
      menu: [
        'crop',
        'flip',
        'rotate',
        'draw',
        'shape',
        'icon',
        'text',
        'mask',
        'filter',
      ],
      initMenu: 'draw',
      uiSize: {
        width: '1000px',
        height: '700px',
      },
      menuBarPosition: 'left',
    }}
    cssMaxHeight={500}
    cssMaxWidth={700}
    selectionStyle={{
      cornerSize: 20,
      rotatingPointOffset: 70,
      cornerColor: 'blue',
      cornerStrokeColor: '#00a9ff',
      borderColor: '#00a9ff',
    }}
    usageStatistics={true}
  />
);

const PaintingPage = () => {
  return (
    <PaintingForm />
  );
};

export default PaintingPage;

Expected Behavior

I want load SVG icon.

Please help me.

image

Can't use without UI

Version - 1.1.0

Test Environment - Chrome

Current Behavior

Can't use the loadImageFromURL without UI. Image is not loading and also there are no docs for react version in the docs section. The document section throws 404 error.

 editorInstance.loadImageFromURL('./abc.png','abc');

Expected Behavior

Image load without UI

Image.setOptions is not a function

Version

Latest

Test Environment

Cordova App, testet on Android

Current Behavior

Trying to start the ImageEditor but only get the black backround.
The ImageUrl looks like this on android:
“file:///storage/emulated/0/Android/data/de.server.test/cache/1566554741747.jpg”

I get the following error:

TypeError: image.setOptions is not a function
    at klass.__setBgOverlayImage (vendors__code.js:119336)
    at klass.setBackgroundImage (vendors__code.js:119251)
    at vendors__code.js:106046
    at new Promise (<anonymous>)
    at new F (vendors__code.js:96350)
    at ImageLoader._setBackgroundImage (vendors__code.js:106043)
    at ImageLoader.load (vendors__code.js:106016)
    at Command.execute (vendors__code.js:111793)
    at Invoker._invokeExecution (vendors__code.js:97694)
    at Invoker.execute (vendors__code.js:97831)

My Code is from you example:

import React from 'react';
import 'tui-image-editor/dist/tui-image-editor.css';
import ImageEditor from '@toast-ui/react-image-editor';

const myTheme = {
  // Theme object to extends default dark theme.
};

const MyImageEditor = imageUrl => (
  <ImageEditor
    usageStatistics={false}
    includeUI={{
      loadImage: {
        path: { imageUrl },
        name: 'SampleImage',
      },
      theme: myTheme,
      menu: ['shape', 'filter'],
      initMenu: 'filter',
      uiSize: {
        width: '1000px',
        height: '700px',
      },
      menuBarPosition: 'bottom',
    }}
    cssMaxHeight={500}
    cssMaxWidth={700}
    selectionStyle={{
      cornerSize: 20,
      rotatingPointOffset: 70,
    }}
  />
);

export default MyImageEditor;

Expected Behavior

Start the application with my picture in it.

CSP Issues?

Hi,

I have setup the editor and have got everything working fine on my local environment. However when tested on an environment with a CSP an unsafe-eval error is thrown in to the console making the editor unusable.

Is this a known issue? And is there a work around for this?

Thanks

submenus stay in old status when i reload a new image

1.2.0

Test Environment

Google Chrome, macOS

Current Behavior

1.do some action on the submenu, changed the submenu UI status
2.call loadImageFromURL to reload a new image to editor
3.reactive the menu last time i use
4.the pop up submenu still in the old UI status.......

for example:
1. i checked the Sepia checkbox on submenu of Filter
2. i called editorInstance.loadImageFromURL(url,name) , reloaded a new Image 
3. i opened Filter menu again, Sepia checkbox was still in checked status

i think it's not what user is expecting, but i have no way to change the behavior

Expected Behavior

Provide an instance method, which can initialize the Menu and Submenu

SSR

thanks for this lib, looks really good
how ever it can't be rendered on server.
I mean i dont need to render image editor itself, it may render empty space but now it just crashes with error

 ~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:1828
     var nav = window.navigator;
            ^
 ReferenceError: window is not defined
     at Object.<anonymous> (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:1828:12)
     at __webpack_require__ (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:36:30)
     at Object.<anonymous> (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:94:17)
     at __webpack_require__ (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:36:30)
     at util (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:56:18)
     at ~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:59:10
     at webpackUniversalModuleDefinition (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:9:20)
     at Object.<anonymous> (~/node_modules/tui-code-snippet/dist/tui-code-snippet.js:16:3)
     at Module._compile (internal/modules/cjs/loader.js:701:30)
     at Module._extensions..js (internal/modules/cjs/loader.js:712:10)

Change image while keeping the filters/texts/objects/etc

How do I change the background image used while retaining the user edits (drawings/effects/texts/etc)?
Using loadImageFromURL and loadImageFromFile clears the user edits which I do not want.
And updating the props on the < ImageEditor/> like loadImage.path does not seem to do anything after the initial render.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.