位置: 编程技术 - 正文

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

  • 小规模纳税人出售使用过的汽车
  • 怎么识别发票是否含税
  • 银行手续费发票图片
  • 财务怎么算社保缴费
  • 金税三期报税软件
  • 未确认融资费用是一级科目吗
  • 非独立核算分公司企业所得税
  • 小规模纳税人实收资本印花税如何交
  • 餐饮会员充值赠送内帐怎么做账务处理
  • 增值税专用发票可以开电子发票吗
  • 民办非企业单位是私立还是公立
  • 年末如何计提企税分录
  • 个人所得税申报错误如何更正申报
  • 免税收入的三个条件
  • 所得税报表怎么申报
  • 视同销售财税处理怎么做?
  • 合并报表实操视频
  • 不能升级win11的二手电脑值得购买吗
  • 部门预算编制方法
  • 主营业务收入平均增长率计算例题
  • wordpress主题dux
  • 电脑打字不显示文字选项
  • 培养自己的php编程能力
  • 填制的凭证内容有哪些
  • 东洛锡安的金黄麦田,苏格兰 (© Scott Masterton/plainpicture)
  • 实际交印花税会计分录
  • php中session什么意思
  • 单目测距精度
  • cpu占满gpu不工作
  • css3的模块结构和应用
  • 原生js操作数组的方法
  • thinkphp pathinfo
  • quota命令 显示磁盘已使用的空间与限制
  • 待抵扣进项税计入其他应收款
  • discuzq开发
  • 旅游服务发票可以抵税吗
  • 商业承兑汇票和银行承兑汇票的分录
  • 交通费怎么报销
  • phpcms不支持缩略图和水印怎么办
  • 登记会计账簿的实训总结
  • 非房地产企业的基建管理办法
  • 高速费会计分录怎么写
  • 所得税的应税所得额
  • 小微企业的资产负债率一般为多少
  • 征地费用会计分录
  • 固定资产计入管理费用就不用折旧了吗
  • 小规模企业申报哪些税
  • 累计扣除包括哪些
  • 影响债券投资收益率的因素有
  • 公司法人的车辆给公司用可以报销费用吗
  • 支付的管理费用调到其他应付款怎么做账
  • 小规模一季度不超过30万是不含税吗
  • 年度损益调整的会计分录
  • win7系统如何打开
  • xp系统 控制面板
  • gentoo安装教程2021
  • linux常用命令修改
  • 怎么检测u盘是否扩容
  • win8删除所有文件
  • 资源管理器 windows
  • 显示演示模式
  • uefi bios ufilify
  • win10极限精简版 200m
  • win7开机无信号之后黑屏
  • 如何打开win7
  • [置顶] 此外,车牌号:458143(懂得都懂[吃瓜])
  • Unity3D Editor类(Inspector) 编写经验总结
  • cocos2dx android横屏竖屏设置
  • opengles入门
  • 深入理解linux内核第三版
  • jquery弹出页面
  • unity3d怎么样
  • nodejs中的session
  • android基础知识
  • 动态生成xml
  • 广西国家税务局于红林
  • 江苏省国家税务局电话号码
  • 北京身份证网上换证流程
  • 税收筹划与避税的性质相同
  • 广州哪里有餐饮费发票
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设