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
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...