Gathering detailed insights and metrics for quill-image-compress
Gathering detailed insights and metrics for quill-image-compress
Gathering detailed insights and metrics for quill-image-compress
Gathering detailed insights and metrics for quill-image-compress
npm install quill-image-compress
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
123 Stars
93 Commits
30 Forks
5 Watching
4 Branches
8 Contributors
Updated on 18 Oct 2024
TypeScript (67.07%)
HTML (25.41%)
JavaScript (7.53%)
Cumulative downloads
Total Downloads
Last day
-8.8%
1,976
Compared to previous day
Last week
-1.5%
10,659
Compared to previous week
Last month
1.1%
46,413
Compared to previous month
Last year
104.6%
435,339
Compared to previous year
1
6
Quill.js Module which compresses images that are uploaded to the editor
yarn add quill-image-compress
gif|jpeg|png|svg|webp|bmp|vnd
NOTE: :exclamation: you don't need quill-image-drop-module
, it's included in this package :exclamation:
1import ImageCompress from 'quill-image-compress';
2
3Quill.register('modules/imageCompress', ImageCompress);
4
5const quill = new Quill(editor, {
6 // ...
7 modules: {
8 // ...
9 imageCompress: {
10 quality: 0.7, // default
11 maxWidth: 1000, // default
12 maxHeight: 1000, // default
13 imageType: 'image/jpeg', // default
14 debug: true, // default
15 suppressErrorLogging: false, // default
16 handleOnPaste: true, //default
17 insertIntoEditor: undefined, // default
18 }
19 }
20});
21
1 <script src="https://cdn.jsdelivr.net/npm/quill-image-compress@2.0/dist/quill.imageCompressor.min.js"></script>
2 <script>
3 Quill.register("modules/imageCompressor", imageCompressor);
4
5 var quill = new Quill("#editor", {
6 modules: {
7 imageCompressor: {
8 quality: 0.9,
9 maxWidth: 1000, // default
10 maxHeight: 1000, // default
11 imageType: 'image/jpeg'
12 }
13 }
14 });
15 </script>
[Integer] maxWidth, maxHeight
[Float] quality
[String] imageType
[Array] keepImageTypes
Preserve image type and apply quality, maxWidth, maxHeight options
[Array] ignoreImageTypes
Image types contained in this array retain their original images, do not compress them.
[Boolean] handleOnPaste
[Function] insertIntoEditor Custom function to handle inserting the image. If you wanted to upload the image to a webserver rather than embedding with Base64, you could use this function.
1insertIntoEditor: (imageBase64URL, imageBlob, editor) => { 2 const formData = new FormData(); 3 formData.append("file", imageBlob); 4 5 fetch("/upload", {method: "POST", body: formData}) 6 .then(response => response.text()) 7 .then(result => { 8 const range = editor.getSelection(); 9 editor.insertEmbed(range.index, "image", `${result}`, "user"); 10 }) 11 .catch(error => { 12 console.error(error); 13 }); 14}
[Boolean] debug
This project is based on quill-image-uploader, thanks mate!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/19 approved changesets -- score normalized to 2
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Morengx-quill
Angular components for the easy use of the QuillJS richt text editor.
quill-image-drop-and-paste
A quill editor module for drop and paste image, with a callback hook before insert image into the editor
lhy-quill-image-compress
A Quill rich text editor Module which compresses images uploaded to the editor
quill-image-uploader
A module for Quill rich text editor to allow images to be uploaded to a server instead of being base64 encoded