PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / intervention / image / src / Intervention / Image / Gd / Commands / InsertCommand.php

InsertCommand.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at vendor/intervention/image/src/Intervention/Image/Gd/Commands/InsertCommand.php

35 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\Image\Gd\Commands;
4
5 use Intervention\Image\Commands\AbstractCommand;
6
7 class InsertCommand extends AbstractCommand
8 {
9 /**
10 * Insert another image into given image
11 *
12 * @param \Intervention\Image\Image $image
13 * @return boolean
14 */
15 public function execute($image)
16 {
17 $source = $this->argument(0)->required()->value();
18 $position = $this->argument(1)->type('string')->value();
19 $x = $this->argument(2)->type('digit')->value(0);
20 $y = $this->argument(3)->type('digit')->value(0);
21
22 // build watermark
23 $watermark = $image->getDriver()->init($source);
24
25 // define insertion point
26 $image_size = $image->getSize()->align($position, $x, $y);
27 $watermark_size = $watermark->getSize()->align($position);
28 $target = $image_size->relativePosition($watermark_size);
29
30 // insert image at position
31 imagealphablending($image->getCore(), true);
32 return imagecopy($image->getCore(), $watermark->getCore(), $target->x, $target->y, 0, 0, $watermark_size->width, $watermark_size->height);
33 }
34 }
35