( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include("../includes/limittext.php");
include('../Connections/videoondemand.php');
require("../DbSql2.inc.php");
require("../NewsSql2.inc.php");
require("../includes/processFunctionsX.php");
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$db = new NewsSQL;
require 'vendor/autoload.php';
use PHPImageWorkshop\ImageWorkshop;
$image=$_GET['image'];
$backgroundColor = "ffffff";
$brandWidth =$_GET['width'];
$brandHeight =$_GET['height'];
$positionX = 0; // px
$positionY = 0; // px
$position = 'MM';
$norwayLayer = ImageWorkshop::initVirginLayer($brandWidth, $brandHeight, $backgroundColor);
$pinguLayer0= ImageWorkshop::initFromPath($image);
$pinguLayer0->cropMaximumInPixel(0, 0, "MM");
if($brandWidth > $brandHeight)
{
$pinguLayer0->resizeInPixel($brandWidth, null, true,$positionX, $positionY, $position);
}
if($brandWidth < $brandHeight)
{
$pinguLayer0->resizeInPixel(null, $brandHeight, true,$positionX, $positionY, $position);
}
if($brandWidth == $brandHeight)
{
$pinguLayer0->resizeInPixel($brandWidth, $brandHeight, true,$positionX, $positionY, $position);
}
$norwayLayer->addLayer(0, $pinguLayer0,0,0);
$image = $norwayLayer->getResult();
header('Content-type: image/png');
imagejpeg($image, null, 100); // We chose to show a JPG with a quality of 95%
exit;
?>