Comparing version 1.0.6-alpha to 1.0.7-alpha
26
index.js
@@ -12,3 +12,3 @@ /** | ||
* @property {number} channels - the number of elements in the dimensions array, corresponding to the number of images processed | ||
* | ||
* | ||
*/ | ||
@@ -24,10 +24,12 @@ const imagemagick = require("imagemagick-stream"); | ||
// Block the decoding of WebP images as a temporary workaround | ||
sharp.block({ operation: ["VipsForeignLoadWebp"] }); | ||
if (sharp.block) { | ||
sharp.block({operation: ["VipsForeignLoadWebp"]}); | ||
} | ||
/** | ||
* | ||
* @param {Buffer} pdf | ||
* @param {number} page | ||
* @param {*} bar | ||
* @returns {Buffer} | ||
* | ||
* @param {Buffer} pdf | ||
* @param {number} page | ||
* @param {*} bar | ||
* @returns {Buffer} | ||
*/ | ||
@@ -76,3 +78,3 @@ const imagemagickconverter = async (pdf, page, bar) => { | ||
* @param {Buffer} pdf Buffer pdf file | ||
* @param {number | number[] | 'all'} page | ||
* @param {number | number[] | 'all'} page | ||
* @param {boolean} [progress=false] progress converting. Default `false` | ||
@@ -117,3 +119,3 @@ * @returns {Promise<Buffer[] | null>} PDF pages converted to image buffers | ||
/** | ||
* Concatenate multiple buffers into a single buffer by providing an array of buffers to the function. | ||
* Concatenate multiple buffers into a single buffer by providing an array of buffers to the function. | ||
* The function processes each buffer, appends them together, and returns the combined buffer. | ||
@@ -130,3 +132,3 @@ * @param {Buffer[]} buffers Array of buffers images | ||
const compositeParams = await Promise.allSettled(buffers.map(async (buffer, index) => { | ||
const image = await sharp(buffer); | ||
const image = sharp(buffer); | ||
const metadata = await image.metadata(); | ||
@@ -159,3 +161,3 @@ const top = dimmention.dimmentions.slice(0, index).reduce((acc, item) => acc + item.height, 0); | ||
/** | ||
* Asynchronous function that takes an array of buffers as an argument. | ||
* Asynchronous function that takes an array of buffers as an argument. | ||
* The function returns an object containing the following information: | ||
@@ -171,3 +173,3 @@ * - outputImgWidth: the maximum width of all the images in the array. | ||
const promises = buffers.map(async (buffer) => { | ||
const bufferImage = await sharp(buffer); | ||
const bufferImage = sharp(buffer); | ||
const metadata = await bufferImage.metadata(); | ||
@@ -174,0 +176,0 @@ |
{ | ||
"name": "pdftopic", | ||
"version": "1.0.6-alpha", | ||
"version": "1.0.7-alpha", | ||
"description": "Built for Node.js, this package empowers users to effortlessly convert PDF files into images of exceptional quality, supporting multiple formats including PNG, JPG, GIF, and others. Its streamlined functionality ensures a smooth and reliable conversion process, providing users with the flexibility to obtain top-notch images from their PDF documents", | ||
@@ -69,3 +69,3 @@ "main": "index.js", | ||
"progress": "^2.0.3", | ||
"sharp": "^0.31.3", | ||
"sharp": "0.33.4", | ||
"stream-to-array": "^2.3.0" | ||
@@ -72,0 +72,0 @@ }, |
39449
245
+ Added@emnapi/runtime@1.3.1(transitive)
+ Added@img/sharp-darwin-arm64@0.33.4(transitive)
+ Added@img/sharp-darwin-x64@0.33.4(transitive)
+ Added@img/sharp-libvips-darwin-arm64@1.0.2(transitive)
+ Added@img/sharp-libvips-darwin-x64@1.0.2(transitive)
+ Added@img/sharp-libvips-linux-arm@1.0.2(transitive)
+ Added@img/sharp-libvips-linux-arm64@1.0.2(transitive)
+ Added@img/sharp-libvips-linux-s390x@1.0.2(transitive)
+ Added@img/sharp-libvips-linux-x64@1.0.2(transitive)
+ Added@img/sharp-libvips-linuxmusl-arm64@1.0.2(transitive)
+ Added@img/sharp-libvips-linuxmusl-x64@1.0.2(transitive)
+ Added@img/sharp-linux-arm@0.33.4(transitive)
+ Added@img/sharp-linux-arm64@0.33.4(transitive)
+ Added@img/sharp-linux-s390x@0.33.4(transitive)
+ Added@img/sharp-linux-x64@0.33.4(transitive)
+ Added@img/sharp-linuxmusl-arm64@0.33.4(transitive)
+ Added@img/sharp-linuxmusl-x64@0.33.4(transitive)
+ Added@img/sharp-wasm32@0.33.4(transitive)
+ Added@img/sharp-win32-ia32@0.33.4(transitive)
+ Added@img/sharp-win32-x64@0.33.4(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedsharp@0.33.4(transitive)
+ Addedtslib@2.8.1(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedchownr@1.1.4(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedini@1.3.8(transitive)
- Removedmimic-response@3.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removednapi-build-utils@2.0.0(transitive)
- Removednode-abi@3.74.0(transitive)
- Removednode-addon-api@5.1.0(transitive)
- Removedpossible-typed-array-names@1.1.0(transitive)
- Removedprebuild-install@7.1.3(transitive)
- Removedpump@3.0.2(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsharp@0.31.3(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@4.0.1(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtar-fs@2.1.2(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
Updatedsharp@0.33.4