Arkatme
Arkatme
Explore posts from servers
DDeno
Created by Arkatme on 8/5/2023 in #help
Resize image/convert on upload
Ah thank you. Got it working eventually
async function uploadAvatar(user_id: string, profileImageFile: File, storage: StorageClient) {
// Initialize ImageMagick
await initialize();

// Read the profileImageFile as a Uint8Array
const fileData: Uint8Array = new Uint8Array(await profileImageFile.arrayBuffer());

// Use ImageMagick to process the image and get the processed data as Uint8Array
const processedData: Uint8Array = ImageMagick.read(fileData, (img: IMagickImage) => {
img.resize(200, 200);

// Use the write() method to specify the output format (MagickFormat.Webp)
return img.write(MagickFormat.Webp, (data: Uint8Array) => data);
});

// Create a new File from the processed data
const processedImageFile = new File([processedData], `${user_id}.webp`, {
type: 'image/webp',
});

// Use the same code for uploading the processed image to Supabase
const filename = `public/${user_id}.webp`;
const { data, error } = await storage.from('avatars').upload(filename, processedImageFile, {
cacheControl: '3600',
upsert: false,
});

if (error) {
console.log(error);
}
}
async function uploadAvatar(user_id: string, profileImageFile: File, storage: StorageClient) {
// Initialize ImageMagick
await initialize();

// Read the profileImageFile as a Uint8Array
const fileData: Uint8Array = new Uint8Array(await profileImageFile.arrayBuffer());

// Use ImageMagick to process the image and get the processed data as Uint8Array
const processedData: Uint8Array = ImageMagick.read(fileData, (img: IMagickImage) => {
img.resize(200, 200);

// Use the write() method to specify the output format (MagickFormat.Webp)
return img.write(MagickFormat.Webp, (data: Uint8Array) => data);
});

// Create a new File from the processed data
const processedImageFile = new File([processedData], `${user_id}.webp`, {
type: 'image/webp',
});

// Use the same code for uploading the processed image to Supabase
const filename = `public/${user_id}.webp`;
const { data, error } = await storage.from('avatars').upload(filename, processedImageFile, {
cacheControl: '3600',
upsert: false,
});

if (error) {
console.log(error);
}
}
3 replies
DDeno
Created by Arkatme on 8/3/2023 in #help
What should my entry point be on Deno Deploy?
2 replies
DDeno
Created by Arkatme on 8/2/2023 in #help
Set a cookie in GET and retrieve in POST
Ended up using sessionStorage. That worked in the end.
4 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
oh im a dumb dumb, it's cause I had the parent folder opened in vscode
8 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
8 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
added but still hasn't made a difference sadly
8 replies
DDeno
Created by Arkatme on 7/30/2023 in #help
Site runs fine but vscode is filled with errors.
Yes I do
8 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
Okay so I found out that if I add those packages to the main console project the errors go away
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained false this is what I use to publish
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
Ah okay that makes sense
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
sorry, this library is a plugin for another console app
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
I've never used dotnet publish for this library. Only for the console app
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
both
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
It used to be able to
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
I just don't understand why it can't load this ould not load file or assembly 'StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46'. The system cannot find the file specified.
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
Yeah, it's meant to be a library
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
no not easily unfortunately
56 replies
CC#
Created by Arkatme on 1/24/2023 in #help
✅ Could not load file or assembly 'StackExchange.Redis
56 replies