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.
gcp_cloud_vision_lines
Advanced tools
This utility breaks down a full text annotation response from the Google cloud vision API into a neatly parsed Array with each element representing a single line of text, with coords and height and width dimensions.
A simple JS function for getting back lines of text with coords and dimensions from Google Cloud vision API.
Please note: This package is not affiliated with Google in any way. I saw a need for a service that provided parsing of the data returned from Google's Cloud Vision API so I filled it.
For more on the Google Cloud Vision API, please go here https://cloud.google.com/vision/docs/reference/rest/
const vision = require('@google-cloud/vision');
const { cloudVisionLines } = require('gcp_cloud_vision_lines');
// This is the boiler plate for authing if you haven't
//used the gcloud CLI to authenticate to your service account
const client = new vision.ImageAnnotatorClient({
projectId: <YOUR PROJECT ID HERE>,
keyFilename: path.resolve(`YOUR/GCP_KEY_FILE_PATH}`)
});
const filePath = 'PATH/TO/THE/FILE/I/WANT/TO/ANALYZE';
const [result] = await client.documentTextDetection(filePath);
cloudVisionLines(result.fullTextAnnotation); // This is the function exported from the module :)
You should get a response that looks like the following
[
{ text: 'Wahaca ', // the text it found
coords:
{ tl: {"x":516,"y":107}, // the top left coord of the line
tr: {"x":636,"y":107}, // the top right coord of the line
br: {"x":636,"y":155}, // the bottom right coord of the line
bl: {"x":516,"y":155}, // the bottom left coord of the line
w: 120, // the width dimension of the line
h: 48 // the height dimension of the line
}
},
{ text: '19 - 23 Charlotte Street ',
coords:
{ tl: {"x":330,"y":156},
tr: {"x":813,"y":156},
br: {"x":813,"y":207},
bl: {"x":330,"y":207},
w: 483,
h: 51
}
}
];
FAQs
This utility breaks down a full text annotation response from the Google cloud vision API into a neatly parsed Array with each element representing a single line of text, with coords and height and width dimensions.
We found that gcp_cloud_vision_lines 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’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.