
when I set the output to WEBP and the original image is from an PNG. I get an black background what should of been transparent.
When I set the background color to white fore example it does set it to white. Only thing is that I cant set that to transparent either in hex for example: ffffff00 should be transparent. But it does not allow those 2 extra hex codes to allow for transparancy
async function getBucketImage(
imageName,
options = {},
bucketId = process.env.IMAGES_BUCKET_ID
) {
if (imageName.includes(".")) imageName = imageName.split(".")[0];
const imageMeta = (await storage.listFiles(bucketId, [], imageName))
?.files[0];
const result = await storage.getFilePreview(
bucketId, // bucketId
imageMeta.$id,
options.width,
options.height,
options.gravity,
options.quality,
options.borderWidth,
options.borderColor,
options.borderRadius,
options.opacity,
options.rotation,
options.background,
options.output
);
if (imageMeta.name.split(".")[0] !== imageName) {
return null;
}
return { type: imageMeta.mimeType, data: result };
}
Recommended threads
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Organization not exists anymore
Hello! We have a problem with a cloud database. We are on the Free plan, but after a refresh the site wants me to create a new organisation, and I not see the c...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
