Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crossOrigin cant be passed via config object #89

Closed
MrGrande opened this issue Nov 9, 2018 · 0 comments
Closed

crossOrigin cant be passed via config object #89

MrGrande opened this issue Nov 9, 2018 · 0 comments
Labels
Enhancement Enhance performance or improve usability of original features.

Comments

@MrGrande
Copy link

MrGrande commented Nov 9, 2018

Version

@Version 3.2.2

Development Environment

Angular 5+

Current Behavior

I am getting 401 while loading images. Its ok, i need to send credentials in the request.
But the only thing i can do at the moment, is to edit the tui-image-editor.js directly and changing from
'Anonymous' to 'use-credentials'.

here:

var imageOption = {
	    padding: 0,
	    crossOrigin: 'use-credentials'
	};

and here:

 key: 'loadImage',
	        value: function loadImage(url, callback, options) {
	            var img = new Image();
	            if (options && options.corsenabled) {
	                img.crossOrigin = 'use-credentials';
	            }
	            img.src = url;
	            img.onload = function () {
	                var canvas = document.createElement('canvas');
	                canvas.width = img.width;
	                canvas.height = img.height;
	                var context = canvas.getContext('2d');
	                context.drawImage(img, 0, 0);
	                callback(canvas);
	            };
	        }

Expected Behavior

It should be possible to pass the crossorigin value over the intialization config object for the editor.
Otherwise i need to hardcode the value directly in the js file which is a really bad practise.

@jinwoo-kim-nhn jinwoo-kim-nhn added the Enhancement Enhance performance or improve usability of original features. label Dec 27, 2018
@lja1018 lja1018 closed this as completed Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhance performance or improve usability of original features.
Projects
None yet
Development

No branches or pull requests

3 participants