
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
JavaScript library for string-encoding images to be served using the picel image processing service microservice / middleware.
Learn more about Picel by reading the project docs.
Install via Bower, npm or clone the repo.
This encoder library works both with Node.JS and on browsers.
picel.encode(image)
Image is a JSON that can contain any of the following keys:
All methods inside the price object that starts with _ (underscore) are to be considered private and you should not rely on them. The only reason it's not scoped inside of a closure is to facilitate testing (but that may change on the future).
It's pretty easy to compose image transformation urls using this library.
Let's start with
var img = {
prefix: "http://localhost:8123/",
path: "7386/11274440243_10456d457d_h.jpg"
};
From there we will extend the img object and invoke the picel.encode successively.
picel.encode(img);
returns
http://localhost:8123/7386/11274440243__10456d457d__h
Which won't work unless you're using a single backend. If you aren't, you've to extend the img object:
img.backend = "https://farm8.staticflickr.com/";
picel.encode(img);
returns
http://localhost:8123/s:farm8.staticflickr.com/7386/11274440243__10456d457d__h
If you want to crop:
img.crop = {
x: 0,
y: 10,
width: 600,
height: 600
};
picel.encode(img);
will return
http://localhost:8123/s:farm8.staticflickr.com/7386/11274440243__10456d457d__h_0x10:600x600
and so on.
By omitting the extension the server will serve you the more appropriate extension.
If you want to force an extension just use img.output = 'jpg'
, for example.
For example:
picel.encode({
"path": "/foo.gif",
"width": 600,
"height": 400,
"output": "webp"
})
should return /foo_600x400_gif.webp
More examples can be recovered from the picel-js/test/fixtures/encode.json test data provider file.
FAQs
Picel accompanying tool for encoding images.
We found that picel 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.