
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@edifice.io/image-resizer
Advanced tools
The ImageResizer
class provides functionality to resize and compress image files. Below is an overview of its methods and usage.
changeDimension(height: number, maxHeight: number, width: number, maxWidth: number): { height: number; width: number }
This private static method adjusts the height and width of an image to fit within the specified maximum dimensions while maintaining the aspect ratio.
renameFileNameExtension(filename: string, newExtension: string): string
This private static method changes the file extension of a given filename to the specified new extension.
resizeImage(image: HTMLImageElement, fileName: string, maxWidth: number, maxHeight: number, compressFormat = "jpeg", quality = 80): Promise<File>
This private static method resizes an image to the specified dimensions and compresses it to the specified quality. It returns a promise that resolves to a File
object.
resizeImageFile(file: File, maxWidth: number = 1440, maxHeight: number = 1440, quality: number = 80): Promise<File>
This public static method resizes and compresses an image file. It returns a promise that resolves to the resized image file.
To use the ImageResizer
class, you can call the resizeImageFile
method with the image file and desired dimensions:
import ImageResizer from "./ImageResizer";
const fileInput = document.getElementById("fileInput") as HTMLInputElement;
fileInput.addEventListener("change", async (event) => {
const file = (event.target as HTMLInputElement).files?.[0];
if (file) {
try {
const resizedFile = await ImageResizer.resizeImageFile(
file,
800,
600,
70,
);
console.log("Resized file:", resizedFile);
} catch (error) {
console.error("Error resizing image:", error);
}
}
});
resizeImageFile
method only supports JPEG format for compression.FAQs
Edifice Image Resizer
The npm package @edifice.io/image-resizer receives a total of 23 weekly downloads. As such, @edifice.io/image-resizer popularity was classified as not popular.
We found that @edifice.io/image-resizer demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.