位置: 编程技术 - 正文

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 创建文件夹)

  • 补缴税款需要去税务大厅吗
  • 实收资本属于限定性净资产吗
  • 公司能经营烟草公司吗
  • 递延所得税资产和负债怎么理解
  • 出纳取备用金需要交税吗
  • 电子税务局中在哪看本月开票统计表
  • 成立小规模纳税人注册资金多少
  • 公司债券投资的优缺点
  • 如何申报加计抵减
  • 部分退货退款剩下的钱什么时候给卖家
  • 项目一次性奖励会计分录怎么处理
  • 国税里发票采集中的税控机动车发票是指什么发票?
  • 营改增后小规模ktv怎么纳税
  • 企业为职工负担的个人所得税是什么意思
  • 减少其他应付款冲费用做以前年度损益调整如何做分录
  • 企业取得出售可供出售金融资产该如何写分录呢?
  • 损失与费用的区别
  • 用于研发的设备如何折旧
  • 公司账户里的钱有利息吗
  • windows10更新怎么办
  • 建安企业享受的税收优惠2020年
  • 权益净利率如何提高
  • 社保会计科目怎么做账
  • 公司已开票给客户,但客户未打款怎么办?
  • 年度应付职工薪酬在科目余额表哪里看
  • 系统之家的系统免费吗
  • 应缴纳增值税计什么科目
  • NDSTray.exe - NDSTray是什么进程 有什么用
  • 房地产企业购地印花税如何入账
  • php中execute
  • 存货成本在哪个表里
  • vscode eslint vue
  • php自定义header
  • 游戏运营服务是做什么的
  • 应收票据年末计息的分录
  • 同一控制下控股合并在合并日合并报表编报正确的有
  • 出售生产设备的会计分录
  • 餐饮费是业务招待费还是差旅费
  • 滴滴打车开具的电子发票可以抵扣吗
  • 发票勾选平台进入后没有什么内容
  • 工业企业变压器容量费用
  • 更改sql server数据库名
  • 企业印花税怎么入账
  • 坏账准备计提额怎么计算
  • 苗木免税只能开普票
  • 现金付款凭证是发票吗
  • 职工短期薪酬包括哪些
  • 银行代发工资流失原因
  • mongodb的常用命令
  • 旅客运输进项抵扣加计扣除怎么算
  • 可转换公司债券名词解释
  • 以股权入资该怎么办
  • 固定资产残值怎么做账务处理
  • 进项税留底怎么处理
  • 建筑安装结转成本分录
  • 加油充值卡开票内容是什么
  • 用友薪资管理怎么取消启用
  • 企业存货计价方法发生变更案例
  • 新建厂房哪些费用可以计入
  • 提前支付利息如何计算
  • 如何解决局域网问题
  • win7系统打开程序卡住几秒怎么办
  • windows 10预览版
  • windows累积更新
  • winxp设置在哪
  • deepin-win
  • win 10移动版
  • Win8.1 32位和64位有什么区别 Win8.1 32位和64区别详细介绍
  • perl获取文件名
  • cocos2dx怎么用
  • angularjs1.5
  • nodejs搭建网站
  • webview自定义视频播放器
  • Javascript中Array.prototype.map()详解
  • 新疆税务局电子
  • 发票系统怎么设置打印
  • 污水处理费收入
  • 雅阁交强险和车船税多少
  • 比利时个人所得税税率
  • 困难减免土地使用税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设