Giter Club home page Giter Club logo

tui.image-editor's Introduction

Toast UI ImageEditor

Full featured image editor using HTML5 Canvas. It's easy to use and provides powerful filters.

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

πŸ“¦ Packages

6 -20-2018 17-45-54

🚩 Table of Contents

🌏 Browser Support

Chrome Chrome IE Internet Explorer Edge Edge Safari Safari Firefox Firefox
Yes 10+ Yes Yes Yes

πŸ’ͺ Has full features that stick to the basic.

Photo manipulation

  • Crop, Flip, Rotation, Drawing, Shape, Icon, Text, Mask Filter, Image Filter

Integration function

  • Download, Image Load, Undo, Redo, Reset, Delete Object(Shape, Line, Mask Image...)
Crop Flip Rotation Drawing Shape
2018-06-04 4 33 16 2018-06-04 4 40 06 2018-06-04 4 43 02 2018-06-04 4 47 40 2018-06-04 4 51 45
Icon Text Mask Filter
2018-06-05 2 06 29 2018-06-05 2 14 36 2018-06-05 2 20 46 2018-06-05 2 27 10

Powerful filter function

  • Grayscale, Invert, Sepia, Blur Sharpen, Emboss, RemoveWhite, Brightness, Noise, Pixelate, ColorFilter, Tint, Multiply, Blend
Grayscale Noise Emboss Pixelate
grayscale noise emboss pixelate
Sepia Sepia2 Blend-righten Blend-diff Invert
sepia sepia2 blend-righten blend-diff invert
Multifly Tint Brightness Remove-white Sharpen
multifly tint brightness remove-white sharpen

πŸ™† Easy to apply the size and design you want

Can be used everywhere.

  • Widely supported in browsers including IE10.

  • Option to support various display sizes. (allows you to use the editor features on your web pages at least over 550 * 450 sizes)

    2018-06-04 5 35 25

Nice default & Fully customizable Themes

  • Has a white and black theme, and you can modify the theme file to customize it.
  • Has an API so that you can create your own instead of the built-in.
black - top black - bottom white - left white - right
2018-06-05 1 41 13 2018-06-05 1 40 24 2018-06-05 1 41 48 2018-06-05 1 42 27

🎨 Features

  • Load image to canvas
  • Undo/Redo (With shortcut)
  • Crop
  • Flip
  • Rotation
  • Resize
  • Free drawing
  • Line drawing
  • Shape
  • Icon
  • Text
  • Mask Filter
  • Image Filter

πŸ”§ 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 if there are any errors.

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

Pull Request

Before uploading your PR, run test one last time to check if there are any errors. If it has no errors, commit and then push it!

For more information on PR's steps, please see links in the Contributing section.

πŸ“™ Documents

πŸ’¬ Contributing

πŸ”© Dependency

🍞 TOAST UI Family

πŸš€ Used By

πŸ“œ License

MIT LICENSE

tui.image-editor's People

Contributors

adzlocal avatar anhdang094 avatar anton-marchenko avatar bigz avatar brendon avatar bugtype avatar dependabot[bot] avatar jinwoo-kim-nhn avatar joelabair avatar jungeun-cho avatar junghwan-park avatar jwehrman avatar kyuwoo-choi avatar leakageek avatar lja1018 avatar maldoinc avatar mountpoint avatar ritvarsz avatar roman-kosov avatar ryuckel avatar seonim-ryu avatar seytar avatar shubh-mehrotra avatar soonoo avatar superlucky84 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  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

tui.image-editor's Issues

Loading image as DataURL in Canvas instead of using physical file

Hi,

I am using this TUI-ImageEditor to manipulate my image. My input format id dataURI. So I don't need the load button as in samples to upload the image.

Is there any way to load DataUrl in canvas instead of sampleImage.png

I could see I need to modify this method:

imageEditor.loadImageFromURL

Can you please tell me, how to achieve this?

Thanks!
Anjali Bansal

Cropzone Issues?

Hi,

I'm trying to incorporate just the Cropzone pieces into my own React app, but am having difficulties. For some reason, when _getCoordinates is hit, canvasEl.getWidth() and canvasEl.getHeight() come back as 1. This essentially draws a small dot it's everything is only 1 square pixel in size.

Have you had any issues like this? When debugging through the core of fabricjs and going through the call stack, looking at this line (12553): this.drawObject(this._cacheContext, noTransform); - I see this._cacheContext being very different than the ctx in the call stack line before (line 6862): objects[i] && objects[i].render(ctx);

In the render line above (6862), the ctx seems to be correct and is pointing to the canvas we need it to point to. However, by the time line 12553 is hit, the _cacheContext is different.

Wondering if you've seen this type of issue?

Rotating the editor instance makes image disappear.

Version

3.2.0

Development Environment

MacOS 10.12.6
Chrome Version 68.0.3440.106 (Official Build) (64-bit)

Current Behavior

Using editorInstance.rotate(degrees) causes entire image/canvas to disappear. The initial image is retrieved from URL on load. I can save and reload images just fine. I can also add text, draw, etc without issue. However using .rotate() immediately makes the image disappear. The number of degrees is irrelevant and reversing the rotation doesn't make it reappear.

Error after installation

Hi
After the npm install --save tui-image-editor The Fabric Js can't found Http and Https modules.

I use: Node js: 8.11.1, NPM 6.1.0, Angular 6.

Installed for Fabric: https://www.npmjs.com/package/@types/fabric

Error code: ERROR in 'node_modules/fabric/dist/fabric.require.js
Module not found: Error: Can't resolve 'http' in 'node_modules\fabric\dist'
ERROR in 'node_modules/fabric/dist/fabric.require.js'
Module not found: Error: Can't resolve 'https' in 'node_modules\fabric\dist'

Import from Node modules: import * as ImageEditor from 'tui-image-editor';

Call the editor: const instance = new ImageEditor(document.querySelector('#tui-image-editor'), { cssMaxWidth: 700, cssMaxHeight: 500, selectionStyle: { cornerSize: 20, rotatingPointOffset: 70 } });
`
Any idea what the problem?

bower.json에 main 속성이 λΉ μ Έ μžˆμŠ΅λ‹ˆλ‹€.

bower install λͺ…λ Ήμ–΄λ‘œ downlaod ν›„ νŠΉμ • μœ„μΉ˜μ— injection을 ν•˜κΈ° μœ„ν•΄ μ•„λž˜ 섀정이 bower.json에 ν•„μš”ν•©λ‹ˆλ‹€.

{
  "name": "tui-image-editor",
  "authors": [
    "NHNEnt FE Development Team <[email protected]>"
  ],
  "description": "",
  "license": "MIT",
  "main": [
    "image-editor.js"
  ],
  "ignore": [
    "**/.*",
    "samples",
    "src",
    "index.js",
    "karma.*",
    "gulpfile.js",
    "jsdoc-conf.json",
    "package.json",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "tui-code-snippet": "~1.2.0",
    "jquery": "~1.8.3",
    "fabric": "~1.6.3"
  },
  "devDependencies": {
    "tui-component-colorpicker": "~1.0.1",
    "filesaver": "*"
  }
}

CDN tui-image-editor.js not working?

Version

latest (3.2.0 I think)

Development Environment

Google Chrome

Current Behavior

Using CDN

<script src="https://uicdn.toast.com/tui-image-editor/latest/tui-image-editor.js"></script>

But got the following error from the console.

tui-image-editor.js:4453 Uncaught TypeError: Cannot read property 'forEach' of undefined
    at keyMirror (tui-image-editor.js:4453)
    at Object.<anonymous> (tui-image-editor.js:4377)
    at __webpack_require__ (tui-image-editor.js:36)
    at Object.<anonymous> (tui-image-editor.js:4233)
    at __webpack_require__ (tui-image-editor.js:36)
    at Object.<anonymous> (tui-image-editor.js:4172)
    at __webpack_require__ (tui-image-editor.js:36)
    at Object.<anonymous> (tui-image-editor.js:3819)
    at __webpack_require__ (tui-image-editor.js:36)
    at Object.module.exports (tui-image-editor.js:604)

Expected Behavior

should load correctly?

이미지 파일이 μ•„λ‹Œ λ‹€λ₯Έ 파일 λ‘œλ“œ 버그

이미지 파일이 μ•„λ‹Œ νŒŒμΌμ„ λ‘œλ“œν•˜λ©΄ 빈 화면이 λ‚˜μ˜€κ²Œ λ©λ‹ˆλ‹€.
그리고 λ‚˜μ„œ λ‹€μ‹œ 일반 이미지 νŒŒμΌμ„ λ‘œλ“œν•˜λ©΄
λ‘œλ“œκ°€ λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μƒ˜ν”Œ νŽ˜μ΄μ§€μ—μ„œ ν…ŒμŠ€νŠΈ ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

Implementing crop ratios

Hi there,

Wondering what the best method is to introduce crop ratios? For example, I would like to possibly incorporate different crop ratios using your library (1x1, 2x3, etc etc), so the crop zone is fixed based on the ratio selected.

What do you feel is the best way to tackle this? Possibly making the proper calculations in _calcRectDimensionFromPoint()?

Thanks

Looks great, but ..

Let me tell you something as non developer. I am spending lot of time into Javascript OS ecosystem, and what is the biggest miss on every OS Repo is live demo link.

Is it to hard deploy app and have live working demo, which can see lot of entrepreneurs, marketing, design and other no technical people ? Which can directly impact of having your OS project getting even more exposure, PR's or paid work ?

Whatever, this is my honest and direct feedback to you and all other open source developers.

Put the Demo of your project online! .

Peace,

setObjectPosition ν•œ 후에 마우슀둜 Objectλ₯Ό 선택할 수 μ—†λŠ” 문제

Version

3.0.0

Development Environment

Chrome 60

Current Behavior

tui image editor의 setObjectPosition() λ™μž‘μ— λŒ€ν•΄ λ¬Έμ˜λ“œλ¦½λ‹ˆλ‹€.
image objectλ₯Ό μΆ”κ°€ ν•œ ν›„ setObjectPosition() APIλ₯Ό 톡해 μœ„μΉ˜λ₯Ό λ³€κ²½ν•˜μ˜€μ„ λ•Œ
λ³€κ²½λœ μœ„μΉ˜μ—μ„œ objectκ°€ μ„ νƒλ˜μ§€ μ•Šκ³ , λ³€κ²½λ˜κΈ° μ „ μœ„μΉ˜μ—μ„œ objectκ°€ μ„ νƒλ©λ‹ˆλ‹€.

λ™μž‘μ€ μ•„λž˜ μˆœμ„œλ‘œ μˆ˜ν–‰ν•œ κ²ƒμž…λ‹ˆλ‹€.

  1. addImageObject()둜 이미지 μΆ”κ°€
  2. μΆ”κ°€ν•œ objectλ₯Ό λΉ„ν™œμ„±(deactivate) μƒνƒœλ‘œ λ³€κ²½ (ν™œμ„±μƒνƒœμΌ λ•Œλ„ λ™μΌν•œ ν˜„μƒ λ°œμƒ)
  3. setObjectPosition()둜 이미지 이동 ({x: 100, y: 100, originX: 'center', originY: 'center'})
  4. μ΄λ™ν•œ μœ„μΉ˜μ—μ„œ object ν™œμ„±ν™”(activate) μ•ˆλ¨, 이동전 μœ„μΉ˜λ₯Ό ν΄λ¦­ν•˜λ©΄ ν™œμ„±ν™”(activate) 됨
imageEditor.setObjectPosition(activeObjectId, {
  x: 200,
  y: 300,
  originX: 'center',
  originY: 'center'
});

// And click it

Expected Behavior

μ΄λ™ν•œ μœ„μΉ˜μ— 마우슀 ν΄λ¦­ν•˜μ˜€μ„ λ•Œλ„ ν™œμ„±ν™” λ˜μ–΄μ•Ό 함.

λΈŒλΌμš°μ € 크기에 따라 μΊ”λ²„μŠ€μ˜ 크기가 μž¬μ‘°μ •λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

κΈ°μ‘΄ div.image-wrapper와 canvas의 높이와 넓이가 κ³ μ •λ κ²½μš°
μ‚¬μš©μžμ˜ ν™˜κ²½ 및 viewport 크기에 따라 ν™”λ©΄ λ…ΈμΆœμ΄ μž˜λ¦¬κ±°λ‚˜ κ³Όλ‹€ν•˜κ²Œ μž‘μ€ μ˜μ—­λ§Œ ν‘œμ‹œλ˜μ–΄ λΆˆνŽΈν•¨μ΄ 초래될 수 μžˆμ„ λ“― ν•©λ‹ˆλ‹€.
νŠΉμ • scale의 factor둜 zoom In out 을 μ²˜λ¦¬ν•΄μ£ΌλŠ” κΈ°λŠ₯이 ν•„μš”ν•  λ“― ν•©λ‹ˆλ‹€.
window.resize에 λŒ€ν•œ μ²˜λ¦¬λŠ” μ™ΈλΆ€μ—μ„œ ν•˜λŠ” 게 쒋을 것 κ°™κ΅¬μš”

toDataURL() type=string error - need object instead string

/**
 * Get data url
 * @param {string} type - A DOMString indicating the image format. The default type is image/png.
 * @returns {string} A DOMString containing the requested data URI
 * @example
 * imgEl.src = imageEditor.toDataURL();
 *
 * imageEditor.loadImageFromURL(imageEditor.toDataURL(), 'FilterImage').then(() => {
 *      imageEditor.addImageObject(imgUrl);
 * });
 */
toDataURL(type) {
    return this._graphics.toDataURL(type);
}

/**
 * To data url from canvas
 * @param {string} type - A DOMString indicating the image format. The default type is image/png.
 * @returns {string} A DOMString containing the requested data URI.
 */
toDataURL(type) {
    return this._canvas && this._canvas.toDataURL(type);
}

But if i open this._canvas.toDataURL (fabric.js):

/**
 * Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately
 * @param {Object} [options] Options object
 * @param {String} [options.format=png] The format of the output image. Either "jpeg" or "png"
 * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.
 * @param {Number} [options.multiplier=1] Multiplier to scale by
 * @param {Number} [options.left] Cropping left offset. Introduced in v1.2.14
 * @param {Number} [options.top] Cropping top offset. Introduced in v1.2.14
 * @param {Number} [options.width] Cropping width. Introduced in v1.2.14
 * @param {Number} [options.height] Cropping height. Introduced in v1.2.14
 * @return {String} Returns a data: URL containing a representation of the object in the format specified by options.format
 * @see {@link http://jsfiddle.net/fabricjs/NfZVb/|jsFiddle demo}
 * @example <caption>Generate jpeg dataURL with lower quality</caption>
 * var dataURL = canvas.toDataURL({
 *   format: 'jpeg',
 *   quality: 0.8
 * });
 * @example <caption>Generate cropped png dataURL (clipping of canvas)</caption>
 * var dataURL = canvas.toDataURL({
 *   format: 'png',
 *   left: 100,
 *   top: 100,
 *   width: 200,
 *   height: 200
 * });
 * @example <caption>Generate double scaled png dataURL</caption>
 * var dataURL = canvas.toDataURL({
 *   format: 'png',
 *   multiplier: 2
 * });
 */
toDataURL: function (options) {
  options || (options = { });

  var format = options.format || 'png',
      quality = options.quality || 1,
      multiplier = options.multiplier || 1,
      cropping = {
        left: options.left || 0,
        top: options.top || 0,
        width: options.width || 0,
        height: options.height || 0,
      };
  return this.__toDataURLWithMultiplier(format, quality, cropping, multiplier);
}

Object instead string!

How do we manually edit currently active text object?

What is the current mechanism by which we set the currently active text object to edit? In the example we can double-click and make the object editable. How do we do this in practice?

I get that we "catch" the active object via objectActivated, but I see nowhere in the documentation anything regarding a text cursor or otherwise. I've also looked at the source of the sample projects, but I see nothing that stands out. Clearly I've overlooked something. πŸ€”

Add Png image in ICON menu

Hello,

Thank you for providing the image editor but now I want to use png image as icon instead of the SVG Path.

Make Icon Arrow to narrow

Hi,

When I add default Arrow icon , its size is quite huge. I've tried multiple methods to reduce its height and width , including the height/width of brush. But its not impacting. As fas as I could see it is plotted via a pathMap:

Arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',

I am not able to understand its structure in terms of height..Can you please manipulate it with a narrow icon ,I mean that may look like thinner arrow.

Thanks!
Anjali Bansal

Multiple object opeartion issue.

when I add two objects on canvas I can not modified the previous object like I add two text or images then I can not rotate move first text or image

Can't add shape after crop

Hi there,

Great code here by the way. Just wanted to let you know that after cropping, I can't add a shape to the canvas.

Thanks

Resize browser window

Hi guys,
is it possible to auto resize editor (canvas, controls,...) when user resize browser window?

Image-Editor as ReactJS Component

Version

3.2.0

Development Environment

ReactJS, HTML5

Current Behavior

We would like to use your component in our app. But we would need it as a ReactJS Component. Are you interested in providing a basic component which basically wraps the whole thing?

// Write example code

Expected Behavior

Integrate the Image-Editor as a ReactJS Component in our mobile app.

Include with NPM

Version

v3.02

Development Environment

Firefox, Windows 10

Current Behavior

_fabric2.default.util is undefined

// Write example code

Expected Behavior

I expected to include with NPM, copy the sample code, and it would work. However, I keep getting this fabric error. I've tried to include fabric with NPM and I've tried manually adding all the dependencies, but it doesn't work. Can you add an example project created with NPM. I have my doubts the NPM package works with the latest version.

Update API refs

Version

3.2.0

Current Behavior

  1. Please check the text bar in api example. backspace doesnt seem to work. and a bit strange behaviour. it is working in 3.1.0 though.
  2. Please Update Api refs to how to change brightness as well as how can i apply filters with more or less values.
    Thanks.

[SECURITY] update package-lock.json for "marked" package

Version

Development Environment

Current Behavior

A module with a potential security vulnerability is found on package-lock.json file.
This module is marked related to jsdoc package and this module's version should be updated.

Reference :

Expected Behavior

Remove node_modules folder and package-lock.json file on local environment.
Install all packages and confirm to update version of marked on package-lock.json.

ν™”μ‚΄ν‘œ 및 λ„ν˜• 그리기 μΆ”κ°€ κΈ°λŠ₯ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬λŠ” μ„ (μžμœ μ„ , 직선)μœΌλ‘œμ„œ κ·Έ μ™Έ λ‹€μ–‘ν•œ λ„ν˜• 좔가에 λŒ€ν•œ μš”μ²­μ΄ λ“€μ–΄μ˜€κ³  μžˆμŠ΅λ‹ˆλ‹€.
기본적인 κ·Έμ™Έ λ„ν˜•(ν™”μ‚΄ν‘œ 및 λ„€λͺ¨, 타원, 원 λ“± ) 에 λŒ€ν•œ μΆ”κ°€κ°€ ν•„μš”ν•œ 상황이며 unicode charset으둜 μ²˜λ¦¬ν•˜λŠ” 것이 이후에 μ’€ 더 μœ μ—°ν•˜κ²Œ κΈ°λŠ₯ μΆ”κ°€κ°€ 될 수 μžˆμ„ λ“― ν•©λ‹ˆλ‹€.
http://unicode-table.com/en/sets/special-symbols/

An error appeared when import a custom icon by clicking Custom icon button

Version

v3.2.0

Development Environment

Chrome v68

Current Behavior

I am running file example01-includeUi.html in examples folder
When I add a custom icon by clicking Custom icon button and choose an image to open then an error appear as follow and a black icon appear on canvas:

graphics.js:649 Uncaught TypeError: Cannot read property 'set' of undefined
at Graphics.setObjectProperties (graphics.js:649)
at ImageEditor.setObjectPropertiesQuietly (imageEditor.js:1366)
at iconCreateResize (action.js:134)
at ImageEditor.r.invoke (tui-code-snippet.min.js:7)
at ImageEditor.r.fire (tui-code-snippet.min.js:7)
at ImageEditor._onIconCreateResize (imageEditor.js:1013)
at Graphics.r.invoke (tui-code-snippet.min.js:7)
at Graphics.r.fire (tui-code-snippet.min.js:7)
at Icon.fire (component.js:36)
at klass.mouseMove (icon.js:82)

Expected Behavior

An normal icon should appear on canvas

how do we get the x and y positions of a Text object using MouseUp event?

Version

3.2.0

Development Environment

Current Behavior

// Write example code
```key: '_onFabricMouseUp',
	        value: function _onFabricMouseUp() {
	            var cropzone = this._cropzone;
	            var listeners = this._listeners;
	            var canvas = this.getCanvas();

	            canvas.setActiveObject(cropzone);
	            canvas.off({
	                'mouse:move': listeners.mousemove,
	                'mouse:up': listeners.mouseup
	            });

## Expected Behavior
<!-- Write a description of the future action. -->

image-editor κ΄€λ ¨ 버그 및 κ°œμ„  사항 λͺ¨μŒμž…λ‹ˆλ‹€.

μ˜μ‘΄μ„±μžˆλŠ” λͺ¨λ“ˆμ˜ 버전 μ •λ³΄μž…λ‹ˆλ‹€.

  • jquery 2.1.4
  • fabric 1.6.6
  • fe-code-snippet 1.2.1
  • tui-image-editor 1.2.0
  1. 이미지λ₯Ό 처음 λ‘œλ”©ν•˜κ±°λ‚˜ λ‘œν…Œμ΄μ…˜ 이후 imageEditor.toDataURL() 을 λͺ…μ‹œμ μœΌλ‘œ ν˜ΈμΆœν•˜μ§€ μ•ŠμœΌλ©΄ ν•˜λ©΄μ— ν‘œμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
imageObjectURL = window.URL.createObjectURL(fileOrBlob);
            imageEditor = new tuiImageEditor('.image-editor canvas', {
                cssMaxWidth: 720, // Component default value: 1000
                cssMaxHeight: 600  // Component default value: 800
            });

            imageEditor.loadImageFromURL(imageObjectURL, fileOrBlob.name);
            imageEditor.on({
                loadImage: function (dimension) {
                    window.URL.revokeObjectURL(imageObjectURL);
                    imageEditor.toDataURL();    //to trick for display image rendering
                },
                emptyUndoStack: function () {
                    $scope.vm.emptyUndo = true;
                },
                emptyRedoStack: function () {
                    $scope.vm.emptyRedo = true;
                },
                pushUndoStack: function () {
                    $scope.vm.emptyUndo = false;
                },
                pushRedoStack: function () {
                    $scope.vm.emptyRedo = false;
                }
            });
function applyRotate(rotate) {
            imageEditor && imageEditor.rotate(rotate);
            imageEditor.toDataURL();    //to trick for display image rendering
        }

        function applyAngle(angle) {
            imageEditor && imageEditor.setAngle(angle);
            imageEditor.toDataURL();    //to trick for display image rendering
        }
  1. 이미지 λ‘œλ”© ν›„ pushUndoStack callback이 무쑰건 1번 ν˜ΈμΆœλ©λ‹ˆλ‹€.
  2. Undo / Redo κΈ°λŠ₯을 ν™œμ„±ν™”/λΉ„ν™œμ„±ν™” ν•˜κΈ° μœ„ν•΄μ„œ μ‚¬μš©ν•˜λŠ” 콜백인데 무쑰건 Undo κΈ°λŠ₯이 ν™œμ„±ν™”λ˜λ©° Undo λ₯Ό 호좜 μ‹œ 기쑴에 λ‘œλ“œλœ 이미지가 μ œκ±°λ©λ‹ˆλ‹€. λ‹€μ‹œ Redo 호좜 μ‹œ 슀크립트 μ—λŸ¬κ°€ λ°œμƒν•©λ‹ˆλ‹€.
    image-editor.js:840 Uncaught TypeError: Cannot read property 'getElement' of null(anonymous function) @ image-editor.js:840(anonymous function) @ fabric.min.js:2n.onerror @ fabric.min.js:1
  3. emptyUndoStack, emptyRedoStack, pushUndoStack, pushRedoStack callback의 arguments λŠ” λͺ¨λ‘ [] κ°’μœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€.
  4. imageEditor.clearObjects() 호좜 μ‹œ λ‘œλ“œλœ 이미지 μ •λ³΄κΉŒμ§€ μ΄ˆκΈ°ν™” λ©λ‹ˆλ‹€.
  5. imageEditor.loadImageFromFile() 을 μ‚¬μš©ν•  경우 λ‚΄λΆ€μ μœΌλ‘œ URL.createObjectURL()을 μ‚¬μš©ν•˜λŠ”λ° 이후 URL.revokeImageObjectURL() 호좜이 λ˜μ§€ μ•ŠμœΌλ©΄ λ©”λͺ¨λ¦¬ 릭이 λ‚  κ°€λŠ₯성이 μžˆμŠ΅λ‹ˆλ‹€. κ΄€λ ¨ μ˜ˆμ™Έμ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

* μ•„λž˜ URLμ—μ„œ 확인가λŠ₯ν•©λ‹ˆλ‹€.*
https://nhnent.dev.dooray.com/messenger?_digest=true
ν΄λ¦½λ³΄λ“œμ— 이미지λ₯Ό ν•˜λ‚˜ λ³΅μ‚¬ν•΄μ„œ λ©”μ‹ μ € 본문에 λΆ™μ΄κ±°λ‚˜, 이미지 νŒŒμΌμ„ λ©”μ‹ μ € 본문에 λ“œλž˜κ·Έ ν•  경우 ν•΄λ‹Ή κΈ°λŠ₯ 확인이 κ°€λŠ₯ν•©λ‹ˆλ‹€.

Can't display editor in VueJS app

Version

3.2.0

Development Environment

MacOS 10.12.6
Chrome Version 68.0.3440.106 (Official Build) (64-bit)

Current Behavior

I realize this probably isn't a priority, but the editor doesn't display in VueJS app. Logging the results to the console shows no errors, and a successful result of the load, however nothing displays. The page literally has no relevant CSS that would hide the editor or otherwise manipulate it. I'm sure I'm missing something simple, but perhaps the JQuery requirements of ToastUI are causing problems? πŸ€”

<template lang="html">
  <div class="">
    <div id="image-editor" class="image-editor">
    </div>
  </div>
</template>

<script>
import ImageEditor from 'tui-image-editor'

export default {
  mounted(){
    this.EditorInstance = new ImageEditor(document.querySelector('#image-editor'), {
        cssMaxWidth: 700,
        cssMaxHeight: 500,
        selectionStyle: {
            cornerSize: 20,
            rotatingPointOffset: 70
        }
    });

    this.EditorInstance.loadImageFromURL(this.imageStoragePath,'image-editor')
      .then(resp=>{
        console.log('RESP',resp)
      })
      .catch(err=>{
        console.log('ERROR',err)
      })
  },
  data(){
    return{
      EditorInstance:null
    }
  },
  methods:{

  },
  computed:{
    imageStoragePath(){
      return '/storage/' + this.photo.path
    }
  },
  props:['photo']
}
</script>

<style lang="css">
</style>

Expected Behavior

It would be nice if I could actually load/view the editor.

Issue in changing corner properties

Version

Any

Development Environment

Any

Current Behavior

I'm trying to change corner details in your js file.
However all the other changes are working except cornerSize .
How can i fix it?

I found that you are using very older version of fabric.
Will upgrading fabric will work in this situation.?

And as a feature request, can you add a method to change corner properties in next update?

Looking forward for response.

tui-image-editor.js line: 3865

fObjectOptions: {
	        SELECTION_STYLE: {
	            borderColor: 'red',
	            cornerColor: 'green',
	            cornerSize: 10,
	            originX: 'center',
	            originY: 'center',
	            transparentCorners: false
	        }
	    },

tui.image-editor as angularJS

Version

3.2.0

Development Environment

Angular JS and Angular projects

Current Behavior

As I checked at the moment this issue is created, ToastUI image-editor has not an angularJS or angular version.

Expected Behavior

It's good to have an angularJS and angular module which can easily integrate with angular projects. Like this Image Editor, "unfortunately it's not Free".

SVG icons are not Loading with webpack

Version

3.2.0

Development Environment

Chrome, Mac 10.13.4

Current Behavior

When importing with Webpack, the SVG icons are not loading because they are pointing to the current page whereas the icons are located inside the node_modules package (screenshot: https://s.zeshanahmed.com/a_2109F674.png).

And I am unable to set the path for the SVG icons either. Checked the documentation, read the code, but can't find any hint.

Here's my code:

var ImageEditor = require( 'tui-image-editor' );
// var blackTheme = require( './js/theme/black-theme.js' );

jQuery(document).ready(function($) {
  const $images = $('.images'),
        $image  = $('.image');

  $image.each((index, el) => {
    console.log( index, $(el) );

    const $el     = $( el );
    const $elImg  = $el.find( 'img' );
    const $edit   = $el.find( '.image__action--edit' );
    const $delete = $el.find( '.image__action--delete' );
    const $upload = $el.find( '.image__upload' );

    $edit.on('click', e => {
      e.preventDefault();

      var instance = new ImageEditor( document.querySelector( '#image-editor-container' ), {
        includeUI: {
          loadImage: {
            path: $el.data( 'image' ),
            name: 'SampleImage'
          },
          // theme: blackTheme, // or whiteTheme
          initMenu: 'filter',
          menuBarPosition: 'bottom'
        },
        cssMaxWidth: 700,
        cssMaxHeight: 500,
        selectionStyle: {
          cornerSize: 20,
          rotatingPointOffset: 70
        }
      });
    });
  });
});

Expected Behavior

I need to find how I can pass a custom path for the SVG icons URLs.

cropμ΄λ‚˜ ν™”λ©΄ λ‘œν…Œμ΄μ…˜ μ‹œ λ³€κ²½λœ μ‹€μ œ μ΄λ―Έμ§€μ˜ 크기둜 μ‘°μ •μ΄λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

μ˜ˆμ „μ— κ°€μ΄λ“œ μ£Όμ‹  λ‚΄μš©μœΌλ‘œλŠ” μ²˜μŒμ— 이미지λ₯Ό λ‘œλ”© ν›„ image-editor wrapper 에 height값을 μ„€μ •ν•˜κ²Œ λ˜μ–΄ μžˆλŠ”λ°μš”.
λ¬Έμ œλŠ” cropμ΄λ‚˜ ν™”λ©΄ λ‘œν…Œμ΄μ…˜ μ‹œ μ‹€μ œ 이미지 크기가 변경됨에도 λΆˆκ΅¬ν•˜κ³  μ›λž˜ 크기의 μ˜μ—­μ΄ κ³΅ν—ˆν•˜κ²Œ λœ¨λŠ” λ¬Έμ œκ°€ λ°œμƒλ˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

μΌ„λ²„μŠ€μ— λ Œλ”λ§λœ 크기λ₯Ό μ •ν™•νžˆ λ°˜μ˜ν•  수 μžˆλŠ” 방법이 ν•„μš”ν•©λ‹ˆλ‹€.

Remove object shape tool

Shape tool is no longer available after removing the last shape.

  1. click shape
  2. create square
  3. select square
  4. click remove selected object
  5. no longer can you create a shape

This also happens if I select the shape object and select delete on the keyboard. ( I suspect they both take the same code path - to removeActiveObject() )
I'm not sure where to look to debug this?

Fabric 2.3.3 does not work

Version

3.1.0

Development Environment

latest Google Chrome

Current Behavior

I get canvasImage.setAngle is not a function when using Fabric 2.3.3.

Fabric 1.6.7 works fine.

Expected Behavior

It should probably work with Fabric 2.3.3 or theDependency section should mention that Fabric 2.3.3 is not supported.

Blur and Highlight on selected area

Hi,

Can you please help me to do the highlight or blur the selected area of image in canvas to highlight and blur..I need these two features as well.

Thanks

How to add multiple text

Version

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7/fabric.js"></script>
--
Β  | <script type="text/javascript" src="https://cdn.rawgit.com/nhnent/tui.code-snippet/v1.2.5/dist/tui-code-snippet.js"></script>
Β  | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
Β  | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js"></script>
Β  | <script type="text/javascript" src="https://cdn.rawgit.com/nhnent/tui.component.colorpicker/1.0.2/dist/colorpicker.min.js"></script>
Β  | <script type="text/javascript" src="http://nhnent.github.io/tui.image-editor/latest/dist/tui-image-editor.js"></script>

Development Environment

Windows 7, browser : Google Chrome

Current Behavior

// Write example code

imageEditor.loadImageFromURL('img/sampleImage.jpg', 'SampleImage').then(sizeValue => {
    console.log(sizeValue);
	imageEditor.addText('hello 1', {
        position: {
					x: 100,
					y: 100
				}
    });
    imageEditor.deactivateAll();

	imageEditor.addText('hello 2', {
        position: {
					x: 300,
					y: 300
				}
    });

    imageEditor.clearUndoStack();
});

Expected Behavior

I want add multiple text but error here

tui-image-editor.js:1795 Uncaught (in promise) The executing command state is locked.
execute @ tui-image-editor.js:1795
execute @ tui-image-editor.js:571
addText @ tui-image-editor.js:1062
imageEditor.loadImageFromURL.then.sizeValue @ service-basic.js:1063
Promise resolved (async)
(anonymous) @ service-basic.js:1053

Please help me. Thank you so much

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.