From: Raphaël Gertz <git@rapsys.eu>
Date: Fri, 22 Nov 2024 02:10:17 +0000 (+0100)
Subject: Add facebook source file
X-Git-Tag: 0.5.4~24
X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/0ae04c58e6b885c2a5ec71a79252bda1058104a6

Add facebook source file
---

diff --git a/public/facebook/source.php b/public/facebook/source.php
new file mode 100644
index 0000000..6cfe80e
--- /dev/null
+++ b/public/facebook/source.php
@@ -0,0 +1,44 @@
+<?php declare(strict_types=1);
+
+/*
+ * This file is part of the Rapsys PackBundle package.
+ *
+ * (c) Raphaël Gertz <symfony@rapsys.eu>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+//Create image object
+$image = new Imagick();
+
+//Create draw object
+$draw = new ImagickDraw();
+
+//Create pixel object
+$pixel = new ImagickPixel('white');
+
+//Create new image
+$image->newImage(1200, 630, $pixel);
+
+//Set fill color
+$draw->setFillColor('black');
+
+//Set font properties
+$draw->setFont('../woff2/droidsans.regular.woff2');
+$draw->setFontSize(30);
+
+//Add texts
+$image->annotateImage($draw, 10, 35, 0, 'RP');
+$image->annotateImage($draw, 10, 615, 0, 'RP');
+$image->annotateImage($draw, 1155, 35, 0, 'RP');
+$image->annotateImage($draw, 1155, 615, 0, 'RP');
+
+//Set image format
+$image->setImageFormat('png');
+
+//Output image header
+header('Content-type: image/png');
+
+//Output image
+echo $image;
diff --git a/public/facebook/source.png b/public/facebook/source.png
new file mode 100644
index 0000000..edcdfeb
Binary files /dev/null and b/public/facebook/source.png differ