Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ngx-default-image
Advanced tools
Angular library which provides a way prevend image rendering when the image loading failed with custom replacement image and provide extracted meta info from the image.
Angular library which provides a way prevend image rendering when the image loading failed with custom replacement image.
Get extracted meta info from the image.
Import the module on your app.module.ts
file as follow.
import { NgxDefaultImageModule} from "ngx-default-image";
imports: [
...
NgxDefaultImageModule
...
],
import { META } from "ngx-default-image";
<img src="'https://dummyimage.com/600x400/fff/000'"
[imageURL]="imageURL" NgxDefaultImage />
Emit the function in order to get meta info as follows.
<img src="'https://dummyimage.com/600x400/fff/000'"
[imageURL]="imageURL" (imageMetaInfo)="imageMetaInfo($event)"
NgxDefaultImage />
import { META } from "ngx-default-image";
public imageMeta: META;
public imageURL = "https://cdn-icons-png.flaticon.com/128/1829/1829412.png"; // Fallback URL
public imageMetaInfo(event: META) {
this.imageMeta = event;
consoloe.log(this.imageMeta);
}
<div *ngFor="let img of images:let index = index;">
<img src="'https://dummyimage.com/600x400/fff/000'"
[imageURL]="imageURL"
(imageMetaInfo)="imageMetaInfo($event, index)"
NgxDefaultImage />
</div>
public imageMetaInfo(event: META, index: number) {
consoloe.log(`Meta info of image at ${index} is ${event}.`);
}
The image will return the meta info as follows:
public imageMetaInfo(event: META) {
this.imageMeta = event;
}
Properties | Data Type |
---|---|
isValidImage | Boolean |
aspectRatio | string |
x | number |
y | number |
rwidth | number |
rheight | number |
renderTime | string |
top | number |
right | number |
bottom | number |
left | number |
datedOn | any |
width | number |
height | number |
src | string |
esrc | string |
alt | string |
crossorigin | string |
To use this package as a service npm i ngx-default-image
install this on the root angular project .
Note: Don't forget to run this commend
npm i ngx-default-image
on root folder or else it will throw error.
Then import the module as follow on imports array
NgxDefaultImageModule
FAQs
Angular library which provides a way prevend image rendering when the image loading failed with custom replacement image and provide extracted meta info from the image.
We found that ngx-default-image demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.