1 year ago

#374596

test-img

Omar

firebase admin storage upload results in blurry image

I am using firebase admin storage to upload images. On my computer the images look fine but after uploading them to firebase they look pixelated and blurry.

"firebase": "^9.6.9",
"firebase-admin": "^10.0.2",

enter image description here

here is my code. The downloadUrl is the one that looks blurry.

import { getStorage } from "firebase-admin/storage";
import { UploadResponse } from "@google-cloud/storage";

async function upload(localFilePath) {
  const uploadResp: UploadResponse = await getStorage()
    .bucket()
    .upload(localFilePath);

  // how can i use UploadResponse to determine a public download url?
  const downloadUrl = await uploadResp[0].getSignedUrl({
    action: "read",
    expires: "03-09-2491",
  });
  return downloadUrl;
}

Also there is no preview in firebase console Error Creating Access Token. I dont know if this is related.

enter image description here

node.js

firebase-storage

firebase-admin

0 Answers

Your Answer

Accepted video resources