
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
locator-image-utility
Advanced tools
Utility module for providing useful operations regarding handling images.
include it in your project
npm install locator-image-utility
// access various regexes
var regex = require('locator-image-utility').regex
regex.imageContentType.match('image/png') // or jpg/jpeg
regex.imageExtension.match('png') //or jpg/jpeg
regex.routePrefix.match('/api/v1/trips/') // everything within four slashes
// get the validation
var validation = require('locator-image-utility').validation
// route with image payload
...
payload: validation.basicImageSchema,
...
// create a image processing unit
var imageUtil = require('locator-image-utility').image
// route with image payload
...
var imageProcessor = imageUtil.processor(request); // request must be a request object from hapi
// will return a useful object containing information about the file
file = imageProcessor.createFileInformation(nameOfFile);
// will return an object used for saving the picture to couchdb
imageProcessor.getAttachmentData(file.filename);
// will crop the stream according to the values in the **request**. The parameters are used for resizing
stream = imageProcessor.createCroppedStream(100, 100);
stream.pipe(someStreamFromDatabase);
...
The following sizes are used to request a picture with the query ```?size=````
- max:
size: { x: 1400, y: 819}
name: 'max'
- mid :
size: {x: 700, y: 410}
name: 'mid'
- small:
size: {x: 400,y: 234}
name: 'small'
- user:
size: {x: 150,y: 150}
name: 'user'
- userThumb:
size: {x: 50,y: 50},
name: 'userThumb'
FAQs
Utility module for handling all image related operation
We found that locator-image-utility demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.