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

is there any way to resize image ? #124

Open
summit2020 opened this issue May 8, 2017 · 6 comments
Open

is there any way to resize image ? #124

summit2020 opened this issue May 8, 2017 · 6 comments

Comments

@summit2020
Copy link

No description provided.

@codewithtyler
Copy link
Contributor

Please see issues #35 and #88.

@summit2020
Copy link
Author

Thanks.. cracked it ..

@icandothat2
Copy link

I solved it this way.

 $.when(readFileIntoDataUrl(fileInfo)).done(function (dataUrl) {
	 var randomID = "I_"+ Math.floor(Math.random() * 20);
	 var imgHTMLstr ='<img id="'+randomID+'" src="'+dataUrl+'"></img>';
          // replaced the original code with insertHTML so we could get an ID on this image
	 execCommand('insertHTML', imgHTMLstr);
		//now that we have the ID we can invoke  jquery  resizeable api
              $(function () {
		            $("#"+randomID).resizable();
		 });
	//just replace the code below with the code above.
      //execCommand('insertimage', dataUrl);//original code

@spreadred
Copy link

@icandothat2 Elegant. Does this actually resize the image though, or simply modify the way it is displayed? IE: If I am sending the editor content to a server via POST for storage, the image will be stored as its original size, correct?

@icandothat2
Copy link

icandothat2 commented May 30, 2018 via email

@spreadred
Copy link

Thanks, I had implemented resizing using canvas for my use case, but I was curious if this worked similarly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants