fix: soo many lint errors
This commit is contained in:
@@ -134,7 +134,7 @@ async function getLocalImage(
|
||||
*/
|
||||
async function storeLocalImage(
|
||||
url: string,
|
||||
content: ArrayBuffer,
|
||||
content: Uint8Array<ArrayBuffer> | ArrayBuffer,
|
||||
{ width, height }: { width?: number; height?: number } = {},
|
||||
) {
|
||||
const isValid = await verifyImage(new Uint8Array(content));
|
||||
@@ -249,7 +249,7 @@ async function verifyImage(imageBuffer: Uint8Array): Promise<boolean> {
|
||||
export async function getImageContent(
|
||||
url: string,
|
||||
{ width, height }: { width?: number; height?: number } = {},
|
||||
): Promise<{ content: ArrayBuffer; mimeType: string }> {
|
||||
): Promise<{ content: Uint8Array<ArrayBuffer>; mimeType: string }> {
|
||||
log.debug("Getting image content", { url, width, height });
|
||||
|
||||
// Check if we have the image metadata in database
|
||||
@@ -267,8 +267,8 @@ export async function getImageContent(
|
||||
// Fetch and cache original if needed
|
||||
if (!originalImage) {
|
||||
const fetchedImage = await getRemoteImage(url);
|
||||
await storeLocalImage(url, fetchedImage.buffer);
|
||||
originalImage = new Uint8Array(fetchedImage.buffer);
|
||||
await storeLocalImage(url, originalImage);
|
||||
}
|
||||
|
||||
// Resize image
|
||||
|
||||
Reference in New Issue
Block a user