{"_id":"@carlos-lopezochoa/quill-image-compress","_rev":"2-06d3d24364b2c23c830501b57cc0e5fc","name":"@carlos-lopezochoa/quill-image-compress","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@carlos-lopezochoa/quill-image-compress","version":"1.0.0","keywords":["quill","quilljs","image","compress","compression","reduce"],"author":{"name":"Carlos López-Ochoa Aledo","email":"carlos.lopezochoa@inercya.com"},"license":"MIT","_id":"@carlos-lopezochoa/quill-image-compress@1.0.0","maintainers":[{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"}],"homepage":"https://github.com/carlos-lopezochoa/quill-image-compress/blob/master/src/demo.html","bugs":{"url":"https://github.com/carlos-lopezochoa/quill-image-compress/issues"},"dist":{"shasum":"2dc22c710d26f1d42545aa0e32b8d8cb54b82b8a","tarball":"https://registry.npmjs.org/@carlos-lopezochoa/quill-image-compress/-/quill-image-compress-1.0.0.tgz","fileCount":29,"integrity":"sha512-wXw0W1Hs1HmNMqDZqjqZ76PiHC3gMNWt+bzaHNlpNX4R+LBzVxp+e44uudkdHikORRygKGJagtzWiGfYupIk4w==","signatures":[{"sig":"MEQCIHpgEyGnu4kpao9+fo0gnY2wokMyD4dvEf1669V7AVSHAiBIVfCC8YKfi1wZ7qXxkXYleOx+YOAc3QGbZs+MWzygfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2218984},"main":"dist/quill.imageCompressor.min.js","types":"types/index.d.ts","gitHead":"9c1a4d3d43d11b5bf7b998834e7881ac4c7bfd23","scripts":{"build":"webpack --mode production","start":"webpack serve --mode development --hot","watch":"webpack --watch --progress --mode development","build-dev":"webpack --mode development"},"_npmUser":{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"},"repository":{"url":"git+https://github.com/carlos-lopezochoa/quill-image-compress.git","type":"git"},"_npmVersion":"10.5.0","description":"A Quill rich text editor Module which compresses images uploaded to the editor (with multiple files support by @carlos-lopezochoa)","directories":{},"_nodeVersion":"20.12.0","_hasShrinkwrap":false,"devDependencies":{"quill":"^2.0.2","webpack":"5.93.0","ts-loader":"^9.5.1","typescript":"^5.5.3","webpack-cli":"5.1.4","webpack-dev-server":"5.0.4"},"peerDependencies":{"quill":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/quill-image-compress_1.0.0_1725955872775_0.6169548079330687","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@carlos-lopezochoa/quill-image-compress","version":"1.0.1","keywords":["quill","quilljs","image","compress","compression","reduce"],"author":{"name":"Carlos López-Ochoa Aledo","email":"carlos.lopezochoa@inercya.com"},"license":"MIT","_id":"@carlos-lopezochoa/quill-image-compress@1.0.1","maintainers":[{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"}],"homepage":"https://github.com/carlos-lopezochoa/quill-image-compress/blob/master/src/demo.html","bugs":{"url":"https://github.com/carlos-lopezochoa/quill-image-compress/issues"},"dist":{"shasum":"5f7579cc01baba4efa9b51908d8bf0c09b5f9523","tarball":"https://registry.npmjs.org/@carlos-lopezochoa/quill-image-compress/-/quill-image-compress-1.0.1.tgz","fileCount":29,"integrity":"sha512-l/w1WGB0JLoxhqPvxSkpHr7X2XQtMHSLEymbVaedi8nwqX1NRxgoDw00SNc+hXNW23kclC60FVpXs20nwQhefQ==","signatures":[{"sig":"MEUCIB9B5ER6mHb0z+Jjrb2eIjD0zkBfBNs5D/yD2TewEhgTAiEAiVF92Ai6KvHonLFLvLpYuQ27LZJlwtMKVMZEmP9g8JM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2219018},"main":"dist/quill.imageCompressor.min.js","types":"types/index.d.ts","gitHead":"0fb4fd2608bb9671798b6ac34b4ce62c8b5a424f","scripts":{"build":"webpack --mode production","start":"webpack serve --mode development --hot","watch":"webpack --watch --progress --mode development","build-dev":"webpack --mode development"},"_npmUser":{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"},"repository":{"url":"git+https://github.com/carlos-lopezochoa/quill-image-compress.git","type":"git"},"_npmVersion":"10.5.0","description":"A Quill rich text editor Module which compresses images uploaded to the editor (with multiple files support by @carlos-lopezochoa)","directories":{},"_nodeVersion":"20.12.0","_hasShrinkwrap":false,"devDependencies":{"quill":"^2.0.2","webpack":"5.93.0","ts-loader":"^9.5.1","typescript":"^5.5.3","webpack-cli":"5.1.4","webpack-dev-server":"5.0.4"},"peerDependencies":{"quill":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/quill-image-compress_1.0.1_1725956037873_0.6608265305331154","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@carlos-lopezochoa/quill-image-compress","description":"A Quill rich text editor Module which compresses images uploaded to the editor (with multiple files support by @carlos-lopezochoa)","version":"1.0.2","main":"dist/quill.imageCompressor.min.js","types":"types/index.d.ts","homepage":"https://github.com/carlos-lopezochoa/quill-image-compress/blob/master/src/demo.html","repository":{"type":"git","url":"git+https://github.com/carlos-lopezochoa/quill-image-compress.git"},"author":{"name":"Carlos López-Ochoa Aledo","email":"carlos.lopezochoa@inercya.com"},"license":"MIT","scripts":{"build":"webpack --mode production","publish":"npm publish --access public"},"keywords":["quill","quilljs","image","compress","compression","reduce"],"peerDependencies":{"quill":"^2.0.2"},"devDependencies":{"quill":"^2.0.2","ts-loader":"^9.5.1","typescript":"^5.5.3","webpack":"^5.94.0"},"_id":"@carlos-lopezochoa/quill-image-compress@1.0.2","gitHead":"71098490b2524ae405f2f5bed9aad734f328caf3","bugs":{"url":"https://github.com/carlos-lopezochoa/quill-image-compress/issues"},"_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-q7Czh4PkIKXrE+PqQ+jr+2DJHHhHrNGryw2NbiWY8ULZGGkaINoYP6lrkRx9DMOsd8iWCJqUIV42kcomhGEaEw==","shasum":"b7d0b354b7219ba113cf7a8c272d1ca89cd30b03","tarball":"https://registry.npmjs.org/@carlos-lopezochoa/quill-image-compress/-/quill-image-compress-1.0.2.tgz","fileCount":13,"unpackedSize":44669,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ0tbedCJw0nXAIRSH3AiF6xGfmk84m3rI5PjGQnPNwAIgY/5H/iCyQIyXWDRfzGWTwgy2LYpDbWiA+de5hcDDTUE="}]},"_npmUser":{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"},"directories":{},"maintainers":[{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-image-compress_1.0.2_1726036889412_0.5927147811744624"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-10T08:11:12.699Z","modified":"2024-09-11T06:41:29.767Z","1.0.0":"2024-09-10T08:11:13.022Z","1.0.1":"2024-09-10T08:13:58.130Z","1.0.2":"2024-09-11T06:41:29.601Z"},"bugs":{"url":"https://github.com/carlos-lopezochoa/quill-image-compress/issues"},"author":{"name":"Carlos López-Ochoa Aledo","email":"carlos.lopezochoa@inercya.com"},"license":"MIT","homepage":"https://github.com/carlos-lopezochoa/quill-image-compress/blob/master/src/demo.html","keywords":["quill","quilljs","image","compress","compression","reduce"],"repository":{"type":"git","url":"git+https://github.com/carlos-lopezochoa/quill-image-compress.git"},"description":"A Quill rich text editor Module which compresses images uploaded to the editor (with multiple files support by @carlos-lopezochoa)","maintainers":[{"name":"carlos-lopezochoa","email":"carlos.lopezochoa@inercya.com"}],"readme":"# quill-image-compress\r\n<!-- [START badges] -->\r\n[![NPM Version](https://img.shields.io/npm/v/quill-image-compress.svg)](https://www.npmjs.com/package/quill-image-compress)\r\n[![License](https://img.shields.io/npm/l/quill-image-compress.svg)](https://github.com/benwinding/quill-image-compress/blob/master/LICENSE)\r\n[![Downloads/week](https://img.shields.io/npm/dm/quill-image-compress.svg)](https://www.npmjs.com/package/quill-image-compress)\r\n[![Github Issues](https://img.shields.io/github/issues/benwinding/quill-image-compress.svg)](https://github.com/benwinding/quill-image-compress)\r\n![Build and Publish](https://github.com/benwinding/quill-image-compress/actions/workflows/push.yml/badge.svg)\r\n<!-- [END badges] -->\r\n\r\nQuill.js Module which compresses images that are uploaded to the editor\r\n\r\n- [Live Demo!](https://benwinding.github.io/quill-image-compress/src/demo.html)\r\n- [Live Demo! (with script tag)](https://benwinding.github.io/quill-image-compress/src/demo-script-tag.html)\r\n\r\n## Install\r\n`yarn add quill-image-compress`\r\n\r\n## Features\r\n\r\n- Will compress image when:\r\n  - Drag/Dropped into quill\r\n  - Pasted into quill\r\n  - Clicked image load button\r\n- Handles most image formats a browser can read:\r\n  - `gif|jpeg|png|svg|webp|bmp|vnd`\r\n- Compression options [more info](#options)\r\n- Add multiple images in one drag/paste\r\n\r\n_NOTE: :exclamation:you don't need `quill-image-drop-module`, it's included in this package:exclamation:_\r\n\r\n## Quickstart\r\n\r\n``` js\r\nimport ImageCompress from 'quill-image-compress';\r\n\r\nQuill.register('modules/imageCompress', ImageCompress);\r\n\r\nconst quill = new Quill(editor, {\r\n  // ...\r\n  modules: {\r\n    // ...\r\n    imageCompress: {\r\n      quality: 0.7, // default\r\n      maxWidth: 1000, // default\r\n      maxHeight: 1000, // default\r\n      imageType: 'image/jpeg', // default\r\n      debug: true, // default\r\n      suppressErrorLogging: false, // default\r\n      handleOnPaste: true, //default \r\n      insertIntoEditor: undefined, // default\r\n    }\r\n  }\r\n});\r\n\r\n```\r\n\r\n## Quickstart (script tag)\r\n\r\n``` html\r\n    <script src=\"https://unpkg.com/quill-image-compress@1.2.11/dist/quill.imageCompressor.min.js\"></script>\r\n    <script>\r\n      Quill.register(\"modules/imageCompressor\", imageCompressor);\r\n      \r\n      var quill = new Quill(\"#editor\", {\r\n        modules: {\r\n          imageCompressor: {\r\n            quality: 0.9,\r\n            maxWidth: 1000, // default\r\n            maxHeight: 1000, // default\r\n            imageType: 'image/jpeg'\r\n          }\r\n        }\r\n      });\r\n    </script>\r\n```\r\n\r\n## Options\r\n\r\n- **[Integer] maxWidth, maxHeight**\r\n  - Maximum width of images (in pixels)\r\n- **[Float] quality**\r\n  - Image quality range: 0.0 - 1.0\r\n- **[String] imageType**\r\n  - Values: 'image/jpeg' , 'image/png' ... etc\r\n- **[Array] keepImageTypes**  \r\n  Preserve image type and apply quality, maxWidth, maxHeight options\r\n  - Values: ['image/jpeg', 'image/png']\r\n\r\n- **[Array] ignoreImageTypes**  \r\n  Image types contained in this array retain their original images, do not compress them.\r\n  - Values: ['image'/jpeg', 'image/webp']\r\n- **[Boolean] handleOnPaste**\r\n  - Compress image on paste, the default behaviour. Set to false to disable processing pasted images.\r\n- **[Function] insertIntoEditor**\r\n  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.\r\n  - Example function, uploading to a webserver:\r\n    ```js\r\n    insertIntoEditor: (imageBase64URL, imageBlob, editor) => {    \r\n      const formData = new FormData();\r\n      formData.append(\"file\", imageBlob);\r\n\r\n      fetch(\"/upload\", {method: \"POST\", body: formData})\r\n        .then(response => response.text())\r\n        .then(result => {\r\n          const range = editor.getSelection();\r\n          editor.insertEmbed(range.index, \"image\", `${result}`, \"user\");\r\n        })\r\n        .catch(error => {\r\n          console.error(error);\r\n        });\r\n    }\r\n    ```\r\n\r\n- **[Boolean] debug**\r\n  - Displays console logs: true/false\r\n\r\n## Thanks\r\nThis project is based on [quill-image-uploader](https://github.com/NoelOConnell/quill-image-uploader), thanks mate!\r\n","readmeFilename":"README.md"}