You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import {src, dest} from 'gulp';
import pump from 'pump';
import jimp from 'gulp-jimp-wrapper';
const font = jimp.loadFont(jimp.FONT_SANS_32_BLACK);
export function images(inputImages, outputImages, cb) {
return pump([
src(inputImages),
jimp(image => image.print(font, 0, 0, {
text: 'hello word',
alignmentX: jimp.HORIZONTAL_ALIGN_CENTER,
alignmentY: jimp.VERTICAL_ALIGN_MIDDLE
})),
dest(outputImages)
], cb);
}
and when I call this module via:
// define gulp plugins
import {series} from 'gulp';
import del from 'del';
// import gulp tasks and source files
import {images} from './gulp-tasks/images';
import {publicSource, devSource} from './gulp-tasks/pathSrc';
// clean css && js dest directory
export const clean = () => del(publicSource.images);
//copy images
export const watermarkImages = cb => images(
devSource.images,
publicSource.images,
cb
);
// default task
export default series(
clean,
watermarkImages
);
I get an error:
TypeError: _gulpJimpWrapper.default.loadFont is not a function
at Object.<anonymous> (/Users/user/Downloads/Code/watermark/gulp-tasks/images.js:5:19)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Module._compile (/Users/user/Downloads/Code/watermark/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Object.newLoader [as .js] (/Users/user/Downloads/Code/watermark/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object.<anonymous> (/Users/user/Downloads/Code/watermark/gulpfile.babel.js:6:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2020-12-08T15_28_01_969Z-debug.log
If you have an any idea what is happening, it will be great.
The text was updated successfully, but these errors were encountered:
I am currently trying to make a watermark using gulp-jimp-wrapper via print() method
(https://github.com/oliver-moran/jimp/tree/master/packages/plugin-print)
and when I call this module via:
I get an error:
If you have an any idea what is happening, it will be great.
The text was updated successfully, but these errors were encountered: