diff --git a/magick.ts b/magick.ts index 56779fb..5b7d8a8 100644 --- a/magick.ts +++ b/magick.ts @@ -13,7 +13,9 @@ function createRoundedImage(profile: Profile) { const args = [ profile.picture, - '-resize', '256x256', + '-resize', '256x256^', + '-gravity', 'center', + '-extent', '256x256', '(', '+clone', '-alpha', 'extract', '-draw', "fill black polygon 0,0 0,128 128,0 fill white circle 128,128 128,0", '(', '+clone', '-flip', ')', '-compose', 'Multiply', '-composite', @@ -53,6 +55,7 @@ export async function generateOgProfileImage(profile: Profile) { if (!magick || !profile.picture) return false; const ogImagePath = `${tmpImgDir}/og-p-${profile.event.id}.png`; + console.log(ogImagePath) const backgroundColor = "#333333"; const fileExists = await checkFileExists(ogImagePath);