@zhaoshijun/compress 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/watermark.js +4 -2
package/package.json
CHANGED
package/src/core/watermark.js
CHANGED
|
@@ -204,7 +204,8 @@ export async function addImageWatermark(sharpInstance, options) {
|
|
|
204
204
|
throw new Error(`Watermark image not found: ${watermarkPath}`);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
const watermarkBuffer = await fs.readFile(watermarkPath);
|
|
208
|
+
let watermarkImage = sharp(watermarkBuffer);
|
|
208
209
|
const watermarkMeta = await watermarkImage.metadata();
|
|
209
210
|
|
|
210
211
|
if (width || height) {
|
|
@@ -321,7 +322,8 @@ export async function addTiledImageWatermark(sharpInstance, options, providedMet
|
|
|
321
322
|
throw new Error(`Watermark image not found: ${watermarkPath}`);
|
|
322
323
|
}
|
|
323
324
|
|
|
324
|
-
|
|
325
|
+
const watermarkBuffer = await fs.readFile(watermarkPath);
|
|
326
|
+
let watermarkImage = sharp(watermarkBuffer);
|
|
325
327
|
const watermarkMeta = await watermarkImage.metadata();
|
|
326
328
|
|
|
327
329
|
if (width || height) {
|