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
Does it support attachting base64 image ? #214
Comments
It does not, but feel free to submit a PR! |
Thanks for answer. Have a nice day! |
I am someone who got fed up with quill as well. Very heavy and I always experienced errors when trying to bundle it. I will take a stab at the base64 image because I think it's a "gotta have" these days. UPDATE: I was able to successfully convert the image action to retrieving a file via the File Explorer using FileReader. I was then able to convert to a base64 image and insert into the document! There's no ability yet to resize the image or to restrict image size, which might be a good idea. I'll do a pull request shortly. |
Nice work folks. The problem here is adding functionality like this to the core package would be just bloat. That being said, it's a great idea for a custom-written action. Rather than a PR, it's a good idea to post what you've written for your custom action here, and I can add it to some sort of "custom actions list" for people to reference in the future. |
Here's a super basic custom action:
I'm sure there's a better way to do this, but it seems to work on a desktop at least. You could pair this with a canvas image editor such as cropper to perform cropping/resizing/etc before embedding or uploading to a server. |
Thanks, I created something very similar months ago and it's working well. I love this rich text editor.
…________________________________
From: Josiah Oslund ***@***.***>
Sent: Wednesday, July 13, 2022 10:38 AM
To: jaredreich/pell ***@***.***>
Cc: Charles Owen ***@***.***>; Comment ***@***.***>
Subject: Re: [jaredreich/pell] Does it support attachting base64 image ? (#214)
Here's a super basic custom action:
{
name: 'image',
result: function () {
var f = document.createElement('input');
f.type = 'file';
f.setAttribute('accept', 'image/*');
f.click();
f.onchange = function (e) {
var r = new FileReader();
r.readAsDataURL(e.target.files[0]);
r.onload = function () {
document.execCommand('insertImage', 0, r.result)
}
}
}
}
I'm sure there's a better way to do this, but it seems to work on a desktop at least. You could pair this with a canvas image editor to perform cropping/resizing/etc before embedding.
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjaredreich%2Fpell%2Fissues%2F214%23issuecomment-1183309124&data=05%7C01%7C%7Cb808bcd106e2443b09b608da64dd5f9f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637933199428365303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RZW80XSj90scrvca5xg7hLpWJHzGL7OhX6xahx8R8NI%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACYCAVT4KB5XJXRGBEQCVDLVT3IG3ANCNFSM44MUOOVA&data=05%7C01%7C%7Cb808bcd106e2443b09b608da64dd5f9f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637933199428365303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fqVaR5cVNVobso6Y%2FRYKiHrJHR6xstiUPg5iO%2F%2FT3Bw%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Currently I am using quilljs.
Not only It's more heavy than pell but also it has critical problem that scrolling top while pasting long text
So I am considering to use pell editor, if I can use base64 image in this editor.
The text was updated successfully, but these errors were encountered: