New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pdftopic

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdftopic - npm Package Compare versions

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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc