位置: 编程技术 - 正文

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

  • 缴纳上一年所得税附件是哪些科目
  • 多缴纳的附加税可以以后期间抵扣吗
  • 发生租赁费用怎么做账
  • 借款人和还款人不相同的情况下逾期还款会影响哪方信用
  • 餐饮业成本的正确表述是
  • 分公司可以成为单位犯罪的主体吗
  • 行政人员出差预借差旅费需要预算会计吗
  • 生产部门领用低值易耗品,实际成本
  • 企业向个人借款合同模板
  • 定额发票不够用可以申请额度要交税吗
  • 个税起征点调整至5000
  • 小企业营业外收入明细
  • 公司向股东借款计入什么科目
  • 公司收到股东的投资款以后怎么处理
  • 企业生产成本核算的一般程序为
  • 劳务费个税申报税率
  • 建筑业交税会计分录
  • 个体户注销未分配利润要交个税吗
  • 房产交易会涉及哪些费用
  • 公司招待客户买的水果怎么入账
  • 哪些项目可以在城镇开发边界外
  • 出口退税申报时间限制
  • 开过去的普通发票多久不能冲红?
  • 银行回单箱费会扣吗
  • 100%控股有什么风险
  • bios设置详细介绍配图
  • PHP:oci_rollback()的用法_Oracle函数
  • 劳务费费用
  • 工程资金占用费的法律依据
  • php文件修改后,打开还是显示以前的页面
  • php ascii
  • 先买入再卖出
  • 人工智能机器人保姆什么时候实现
  • 支付职工教育经费
  • php实现的http请求封装示例
  • 多交增值税可以做营业外支出吗
  • 301重定向到https 并且不带www跳转到带www
  • 进销存表格模板明细账
  • 销售折扣收货方法有哪些
  • 存货出入库需要什么凭证
  • 进口增值税完税证明网哪里打印的
  • 不合格机器设备怎么处理
  • 通过SQL Server 2008数据库复制实现数据库同步备份
  • 企业内部交易如何操作
  • 水利建设基金现在入费用还是入应交税费了
  • 初次购买金税盘怎么做账
  • 进项有效期
  • 在建工程借款利息计入哪里
  • 复利现值和复利终值互为逆运算对吗
  • 公司转投资是什么意思
  • 公司转给其他公司的投资款
  • 一般纳税人外购货物发生非正常损失,不包括
  • 其他应付款的借贷方分别表示什么
  • 待抵扣进项税额借贷方向
  • 明细账怎么弄
  • Mysql5.7.11在windows10上的安装与配置(解压版)
  • mariadb10.1
  • mysql数据库性能监控
  • 文件历史版本功能
  • FreeBSD 6.2用freebsd-update升级过程
  • 苹果怎样快速移动应用到其他桌面
  • mac连电视
  • win7没有媒体功能
  • host文件没有
  • unity对象池优缺点
  • qt creator kit
  • svn服务端启动
  • shell判断文件是否存在且大小不为0
  • python xml文件转化为excel
  • js动态生成的id怎样获取
  • nodejs eventloop
  • css伸缩弹动特效
  • 丹麦个人所得税税率表
  • 山西社保查询网址
  • 纳税人分类分级管理四个匹配
  • 江苏国税电子税务局网上申报流程
  • 螺丝钉的税率
  • 副局长是由局长任命的吗
  • 补办契税需要哪些资料
  • 地税收税标准
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设