![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
gulp-imgconv
Advanced tools
a gulp plugin to convert images (format conversion, resizing, cutting in/out, watermarking etc.) for distribution or batch image processing
A gulp plugin to convert images (format conversion, resizing, cutting in/out, watermarking etc.) for distribution or batch image processing
npm install gulp-imgconv --save-dev
src/
, cutin with a round shape, add a watermark, sharpen, grascale, boolean with a 5-pointed star and save them to dst/
in PNG formatconst gulp = require('gulp'),
gic = require('gulp-imgconv');
exports.imgconv = () => {
gulp.src('src/*')
.pipe(gic(gic
.begin()
.resize({
width: 640,
height: 480,
fit: 'contain',
background: '#00000000'
})
.cutin(Buffer.from(`<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="360" height="360" viewBox="0 0 480 480">
<circle r="240" cx="240" cy="240"/>
</svg>`))
.watermark('png/watermark.png', {
left: 400,
top: 280
})
.sharpen()
.grayscale()
.boolean(Buffer.from(`<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="255" height="240" viewBox="-20 0 71 48">
<title>Five Pointed Star</title>
<path fill="none" stroke="#000" d="m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z"/>
</svg>`),
'eor'
)
.toFormat('png', {
quality: 80
})
.commit()
))
.pipe(gulp.dest('dst/'));
};
Click below links to see the conversion effect
src/
to width = 800, sharpen, grayscale them and save to dst/
in corresponding formats (SVG, GIF -> PNG, otherwise the original format)const gulp = require('gulp'),
gic = require('gulp-imgconv');
exports.imgconv = () => {
gulp.src('src/*')
.pipe(gic(gic
.begin()
.resize({
width: 800,
fit: 'contain',
background: '#00000000'
})
.sharpen()
.grayscale()
.commit()
))
.pipe(gulp.dest('dst/'));
};
resize
function
width
and height
are size to resize to; when any parameter is ommitted, its value will be determined by fit
option. Please refer to resizeOptsHelper
object of this package to learn how to make up a correct opts object.fmt
is the format to convert to (right now supports jpeg, png, tiff and webp). There are quite a few option choices for each format, please find more details from sharp official documentcomposite
function
src
is either the svg/png file name (in string) or the data (in Buffer) to overlay upon the original image, and you can learn how to construct the basic opts
argument with the help of compositeOptsHelper
, or read sharp official document to comprehensively understand the exact meaning of each option.begin()
and ended by commit()
.gulpfile.js
file:Special gratitude to sharp and other dependencies
tibetty xihua.duan@gmail.com
FAQs
a gulp plugin to convert images (format conversion, resizing, cutting in/out, watermarking etc.) for distribution or batch image processing
The npm package gulp-imgconv receives a total of 0 weekly downloads. As such, gulp-imgconv popularity was classified as not popular.
We found that gulp-imgconv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.