New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

oss-img-processor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

oss-img-processor

a img resize tool

unpublished
latest
npmnpm
Version
0.0.3-beta
Version published
Maintainers
1
Created
Source

oss 图片处理工具

这是一个oss处理图片的函数,主要处理图片尺寸信息和图片格式转换。 它会自动判断当前浏览器是否支持webp格式,当你需要转换图片的时候(png to jpg),如果当前浏览器支持webp,则以webp格式转换,否则转为jpg。

Installation

npm install --save oss-img-processor

Usage

// main.js

import resizeImg from 'oss-img-processor/lib/index';

Vue.prototype.$resizeImg = resizeImg;

例子

// 将图片大小以`宽度`为基准,按比例设置为 `width=200` 的图片`且`开启图片转换

<img :src="$resizeImg(url, 200, 0, true)" alt="">
// 将图片大小以`高度`为基准,按比例设置为 `height=200` 的图片`且`开启图片转换

<img :src="$resizeImg(url, 0, 200, true)" alt="">
// 将图片大小以`宽度`为基准,按比例设置为 `width=200` 的图片`不`开启图片转换

<img :src="$resizeImg(url, 200, 0)" alt="">

Keywords

oss

FAQs

Package last updated on 08 Jan 2019

Did you know?

Socket

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.

Install

Related posts