Crop profile images to square format for preview
This commit is contained in:
parent
49d5aa4487
commit
7f9a5fdae5
@ -13,7 +13,9 @@ function createRoundedImage(profile: Profile) {
|
|||||||
|
|
||||||
const args = [
|
const args = [
|
||||||
profile.picture,
|
profile.picture,
|
||||||
'-resize', '256x256',
|
'-resize', '256x256^',
|
||||||
|
'-gravity', 'center',
|
||||||
|
'-extent', '256x256',
|
||||||
'(', '+clone', '-alpha', 'extract',
|
'(', '+clone', '-alpha', 'extract',
|
||||||
'-draw', "fill black polygon 0,0 0,128 128,0 fill white circle 128,128 128,0",
|
'-draw', "fill black polygon 0,0 0,128 128,0 fill white circle 128,128 128,0",
|
||||||
'(', '+clone', '-flip', ')', '-compose', 'Multiply', '-composite',
|
'(', '+clone', '-flip', ')', '-compose', 'Multiply', '-composite',
|
||||||
@ -53,6 +55,7 @@ export async function generateOgProfileImage(profile: Profile) {
|
|||||||
if (!magick || !profile.picture) return false;
|
if (!magick || !profile.picture) return false;
|
||||||
|
|
||||||
const ogImagePath = `${tmpImgDir}/og-p-${profile.event.id}.png`;
|
const ogImagePath = `${tmpImgDir}/og-p-${profile.event.id}.png`;
|
||||||
|
console.log(ogImagePath)
|
||||||
const backgroundColor = "#333333";
|
const backgroundColor = "#333333";
|
||||||
const fileExists = await checkFileExists(ogImagePath);
|
const fileExists = await checkFileExists(ogImagePath);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user