fix: png files are not transformed
This commit is contained in:
parent
83ebdcbf21
commit
4f2cdaa302
|
@ -42,12 +42,14 @@ export const POST: APIRoute = async ({ request }) => {
|
||||||
|
|
||||||
const imageBuf = await image.arrayBuffer()
|
const imageBuf = await image.arrayBuffer()
|
||||||
|
|
||||||
const { data } = await sharpService.transform(
|
const { data, format } = await sharpService.transform(
|
||||||
new Uint8Array(imageBuf),
|
new Uint8Array(imageBuf),
|
||||||
{ src: imageName },
|
{ src: imageName, format: "webp" },
|
||||||
{ domains: [], remotePatterns: [], service: { entrypoint: "", config: { limitInputPixels: false } } }
|
{ domains: [], remotePatterns: [], service: { entrypoint: "", config: { limitInputPixels: false } } }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
console.log(format)
|
||||||
|
|
||||||
const { error } = await supabase.storage.from("images").upload(`public/${imageName}`, data, {
|
const { error } = await supabase.storage.from("images").upload(`public/${imageName}`, data, {
|
||||||
cacheControl: "3600",
|
cacheControl: "3600",
|
||||||
upsert: false,
|
upsert: false,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user