
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
image-resource
Advanced tools
Image resource provide a simple way to load images using promises, and patch IE naturalWidth and naturalHeight for SVG.
Image resource provide a simple way to load images using promises, and patch IE naturalWidth and naturalHeight for SVG.
ImageResource.load('my-image.svg').then((image) => {
document.body.append(image.image);
console.log(image.naturalWidth, image.naturalHeight);
});
load(source: string): Promise<ImageResource>;
Load an image from an url. Return a promise resolved when image loading is complete.
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
dispatchEvent(event: Event): boolean;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
It's possible to bind events like any other EventTarget.
readonly naturalWidth: number;
readonly naturalHeight: number;
It's possible to read the natural size of the image (working on IE with SVG too).
public image: HTMLImageElement;
Finally, it's possible to acces to the original Image element through imageResource.image
FAQs
Image resource provide a simple way to load images using promises, and patch IE naturalWidth and naturalHeight for SVG.
We found that image-resource 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.