位置: 编程技术 - 正文

nodejs处理图片的中间件node-images详解(nodejs image)

编辑:rootadmin

推荐整理分享nodejs处理图片的中间件node-images详解(nodejs image),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:nodejs 图片,node canvas处理图片,nodejs image,node canvas处理图片,nodejs 图片处理,node 图片处理,node 图片处理,nodejs 显示图片,内容如对您有帮助,希望把文章链接给更多的朋友!

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Node.js

node.js轻量级跨平台图像编解码库

Features 功能特性

Lightweight:no need to install any image processing library. 轻量级:无需安装任何图像处理库。 Cross-platform: Released a compiled .node file on windows, just download and start. 跨平台:Windows下发布了编译好的.node文件,下载就能用。 Easy-to-use: Provide jQuery-like chaining API.Simple and reliable! 方便用:jQuery风格的API,简单可依赖。

Installation 安装

API 接口

node-images provide jQuery-like Chaining API,You can start the chain like this:

node-images 提供了类似jQuery的链式调用API,您可以这样开始:

images(file)

Load and decode image from file从指定文件加载并解码图像

images(width, height)

Create a new transparent image创建一个指定宽高的透明图像

images(buffer[, start[, end]])

Load and decode image from a buffer从Buffer数据中解码图像

images(image[, x, y, width, height])

Copy from another image从另一个图像中复制区域来创建图像

.fill(red, green, blue[, alpha])

eg:images(, ).fill(0xff, 0x, 0x, 0.5) Fill image with color以指定颜色填充图像

.draw(image, x, y)

Draw image on the current image position( x , y )在当前图像( x , y )上绘制 image 图像

.encode(type[, config])

eg:images("input.png").encode("jpg", {operation:}) Encode image to buffer, config is image setting.

以指定格式编码当前图像到Buffer,config为图片设置,目前支持设置JPG图像质量

Return buffer

nodejs处理图片的中间件node-images详解(nodejs image)

返回填充好的Buffer

Note:The operation will cut off the chain

注意:该操作将会切断调用链

See:.save(file[, type[, config]]) 参考:.save(file[, type[, config]])

.save(file[, type[, config]])

eg:images("input.png").encode("output.jpg", {operation:}) Encoding and save the current image to a file, if the type is not specified, type well be automatically determined according to the file, config is image setting. eg: { operation: }编码并保存当前图像到 file ,如果type未指定,则根据 file 自动判断文件类型,config为图片设置,目前支持设置JPG图像质量

.size([width[, height]])

Get size of the image or set the size of the image,if the height is not specified, then scaling based on the current width and height获取或者设置图像宽高,如果height未指定,则根据当前宽高等比缩放

.resize(width[, height])

Set the size of the image,if the height is not specified, then scaling based on the current width and height

设置图像宽高,如果height未指定,则根据当前宽高等比缩放, 默认采用 bicubic 算法。

.width([width])

Get width for the image or set width of the image获取或设置图像宽度

.height([height])

Get height for the image or set height of the image获取或设置图像高度

images.setLimit(width, height)

Set the limit size of each image 设置库处理图片的大小限制,设置后对所有新的操作生效(如果超限则抛出异常)

images.setGCThreshold(value)

Set the garbage collection threshold 设置图像处理库自动gc的阈值(当新增内存使用超过该阈值时,执行垃圾回收)

images.getUsedMemory()

Get used memory (in bytes)得到图像处理库占用的内存大小(单位为字节)

images.gc()

Forced call garbage collection 强制调用V8的垃圾回收机制

详解node中创建服务进程 背景在node工程部署中,常常涉及到三方:本地客户端、跳板机和服务器(集群)。在通过git触发gitlabhook脚本后,需要在跳板机中执行相应的ssh命令执行

利用forever和pm2部署node.js项目过程 本文主要给大家分享的是利用forever和pm2部署node.js项目过程的相关内容,分享出来供大家参考学习,下面来看看详细的介绍:一、foreverforever可以在cmd或s

利用PM2部署node.js项目的方法教程 前言大家在开发中应该发现了,如果直接通过nodeapp来启动,如果报错了可能直接停在整个运行,supervisor感觉只是拿来用作开发环境的。再网上找到pm2.

标签: nodejs image

本文链接地址:https://www.jiuchutong.com/biancheng/379461.html 转载请保留说明!

上一篇:node.js中EJS 模板快速入门教程(node js模块)

下一篇:详解node中创建服务进程(node 创建文件夹)

  • 收到政府的补贴收入现金流量表填哪里
  • 软件企业购进软件服务怎么入账
  • 固定资产账面金额什么意思
  • 分公司企业所得税怎么缴纳
  • 结构性存款是
  • 商业企业能否计税
  • 农林牧渔业项目概述怎么写
  • 小微企业增值税免税政策2023年
  • 保险营销员的佣金怎么算个税
  • 外贸企业当期认证的发票没申报影响退税吗?
  • 国外汇款 用什么理由
  • 财务费用利息收入在损益表中怎么填
  • 固定资产清理出售合同
  • 制造费用分配的的标准是什么?
  • google搜索打不开怎么办
  • 疫情期间企业贷款利率多少
  • 电脑装机光盘
  • PHP:xml_parser_set_option()的用法_XML解析器函数
  • 预交税款分录
  • 递延所得税当期要交吗
  • php 字符串
  • 怎样做好固定资产管理工作
  • 口腔发炎怎么办最快最有效的方法
  • 系统win7旗舰版
  • modelist模型
  • 内账怎么处理增值税
  • 股东无偿投入的土地需要摊销吗
  • js怎么实现倒计时
  • 老老实实的人
  • 电脑找不到应用程序的图标怎么删除
  • 采矿权如何进行融资
  • 试运行收入会计分录
  • 免抵退税的会计分录
  • 即征即退进项税怎么划分合算
  • 将织梦dedecms转换到wordpress
  • 原材料折价销售怎么算
  • 门诊收费票据能重新打印吗
  • 固定资产分期付款会计处理?
  • 影响存货管理的因素有哪些
  • 收到境外企业顾问费
  • sqlserver2008r2数据库导出教程
  • 视同销售的会计分录有哪些?
  • mysql分页优化原理
  • mysql数据类型和索引
  • 个税专项附加扣除标准2023
  • pos机收款不开票怎么做账
  • 怎样计提税金及附加
  • 自然灾害的原因有哪些
  • 现金付发票再摊销怎么算
  • 银行贷款需要哪些材料
  • 发票上有银行流水号吗
  • 企业的融资租赁
  • 如何结转完工产品成本和已销产品成本
  • 本年利润是什么科目?
  • 公司卖土地怎么避税
  • 广告制作费属于现代服务吗
  • 外贸企业怎么开出口发票
  • xp系统环境变量
  • 注册表被锁定后的处理方法
  • Windows Server 2008网络安全与终端服务
  • win7电脑频繁自动重启是什么原因造成的
  • win7更改电脑设置在哪里
  • linux grub2
  • win7双硬盘双系统
  • ubuntu命令行浏览网页
  • VMware虚拟机下载
  • 在Linux操作系统中哪些命令可以正确关闭系统防火墙
  • 双系统如何迁移到固态硬盘
  • Linux查看内存的命令是
  • java中遍历数组的方法
  • 鼠标滑动页面缩放取消
  • opencv人脸识别模型训练
  • android!
  • 批处理实现语音报警
  • python批量创建文件
  • input限制数字大小
  • jq中attr用法
  • 如何办理委托银行卡业务
  • 租房交税是房东交还是中介交
  • 360浏览器hi真不巧
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设