Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
apng-optimizer
Advanced tools
基于 WebAssembly 的 APNG 图片压缩工具。
底层基于 libimagequant 与 APNG Optimizer
npm run demo
在开始使用前,我们需要配置我们的打包工具(如 webpack)来支持加载 WebAssembly:
module.exports = {
module: {
rules: [{
test: /\.wasm$/,
use: [{
loader: 'file-loader'
}]
}]
}
}
import { APNGOptimizer } from 'apng-optimizer';
import assemblyPath from 'apng-optimizer/dist/apng-optimizer.wasm';
APNGOptimizer.createOptimizer(assemblyPath)
.then(optimizer => {
// ... load your apng image as buffer
const uint8Array = new Uint8Array(buffer);
const optAPNGArray = optimizer.optAPNG(uint8Array, {
minQuality: 0,
maxQuality: 100,
processCallback: function(progerss) {
console.log(progress); // 0.1231111
}
});
const blob = new Blob([optAPNGArray.buffer], { type: 'image/png' });
const url = URL.createObjectURL(blob);
img.src = url;
});
通过加载 modulePath
路径上的 WebAssembly 来创建一个新的压缩器实例
压缩 apng 图片
1
15
imagequant
进行色板取色的最小质量,默认为 0
imagequant
进行色斑取色的最大质量,默认为 100
imagequant
,禁用后 minQuality
与 maxQuality
将会无效progress
为当前压缩进度( 0 ~ 1)FAQs
Optimizes APNG animations for js
We found that apng-optimizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.