
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@3846masa/bmp
Advanced tools
Create a BMP (w/ alpha channel) binary from RGBA raw bytes like ImageData.
Create a BMP (w/ alpha channel) binary from RGBA raw bytes like ImageData.
See ./examples/basic.
<script type="module">
import { convert } from 'https://unpkg.com/@3846masa/bmp/lib/convert.mjs';
const canvas = document.getElementById('canvas');
const bmpImg = document.getElementById('bmp');
function main() {
const ctx = canvas.getContext('2d');
const raw = ctx.getImageData(0, 0, canvas.width, canvas.height);
const bmpBinary = convert(raw);
const blob = new Blob([bmpBinary], { type: 'image/bmp' });
bmpImg.src = URL.createObjectURL(blob);
}
main();
</script>
See ./examples/webworker.
<script type="module">
import { convert } from 'https://unpkg.com/@3846masa/bmp/lib/worker.mjs';
const canvas = document.getElementById('canvas');
const bmpImg = document.getElementById('bmp');
async function main() {
const ctx = canvas.getContext('2d');
const raw = ctx.getImageData(0, 0, canvas.width, canvas.height);
const bmpBinary = await convert(raw);
const blob = new Blob([bmpBinary], { type: 'image/bmp' });
bmpImg.src = URL.createObjectURL(blob);
}
main().catch(console.error);
</script>
See ./examples/canvas-to-blob.
<script src="https://unpkg.com/@3846masa/bmp/lib/polyfill.js"></script>
<script>
const canvas = document.getElementById('canvas');
const bmpImg = document.getElementById('bmp');
function main() {
canvas.toBlob(callback, 'image/bmp');
function callback(blob) {
bmpImg.src = URL.createObjectURL(blob);
}
}
main();
</script>
npm i @3846masa/bmp
import { convert } from '@3846masa/bmp';
convert({ width, height, data }, options?)
Convert RGBA raw bytes like ImageData to a BMP binary.
In worker.mjs
, this function returns Promise.
width | number |
height | number |
data | Uint8Array | Uint8ClampedArray |
options.strict | boolean |
Returns | Uint8Array | Promise<Uint8Array> |
HTMLCanvasElement.prototype.toBlob(callback, type)
callback | (blob: Blob) => any |
type | 'image/bmp' |
PRs accepted.
FAQs
Create a BMP (w/ alpha channel) binary from RGBA raw bytes like ImageData.
The npm package @3846masa/bmp receives a total of 53 weekly downloads. As such, @3846masa/bmp popularity was classified as not popular.
We found that @3846masa/bmp demonstrated a not healthy version release cadence and project activity because the last version was released 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.