]> Raphaël G. Git Repositories - packbundle/commitdiff
Add facebook source file
authorRaphaël Gertz <git@rapsys.eu>
Fri, 22 Nov 2024 02:10:17 +0000 (03:10 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Fri, 22 Nov 2024 02:10:17 +0000 (03:10 +0100)
public/facebook/source.php [new file with mode: 0644]
public/facebook/source.png [new file with mode: 0644]

diff --git a/public/facebook/source.php b/public/facebook/source.php
new file mode 100644 (file)
index 0000000..6cfe80e
--- /dev/null
@@ -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 (file)
index 0000000..edcdfeb
Binary files /dev/null and b/public/facebook/source.png differ