( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include("includes/limittext.php");
include('Connections/videoondemand.php');
require("DbSql.inc.php");
require("NewsSql.inc.php");
$db = new NewsSQL($DBName);
function filter($arr) {
global $link;
return array_map(array($link, 'real_escape_string'), $arr);
}
$_GET = filter($_GET);
$_POST = filter($_POST);
$mode=$_GET["mode"];
include("protect.php");
if (empty($page)) {
$page = 0;
}
function findSharp($orig, $final) // function from Ryan Rud (http://adryrun.com)
{
$final = $final * (750.0 / $orig);
$a = 52;
$b = -0.27810650887573124;
$c = .00047337278106508946;
$result = $a + $b * $final + $c * $final * $final;
return max(round($result), 0);
} // findSharp()
/** Apply a PNG overlay */
function gd_apply_overlay($background, $brand, $amount)
{
if ($_GET['action']=="cards")
{
$width = 640; $height = 430;
}
else
{
if (!empty($_GET['description']))
{
$width = 640; $height = 400;
}
else
{
$width = 500; $height = 666;
}
}
// Get the size and MIME type of the requested image
/*$size = GetImageSize($docRoot . $image);
$mime = $size['mime'];*/
$photoFrame2 = imagecreatetruecolor($width, $height);
imagealphablending($photoFrame2, false);
imagesavealpha($photoFrame2, true);
$trans_colour = imagecolorallocatealpha($photoFrame2, 0, 0, 0, 127);
imagefilledrectangle($photoFrame2, 0, 0, $width, $height, $trans_colour);
$mag = $brand;
$brand = 'filters/effects2/' . $brand . '.png';
$photo2 = imagecreatefrompng($brand);
include("mags/switch.php");
imagecopyresampled($photoFrame2, $photo2, 0, 0, 0,0, $width, $height, $width, $height);
$photoFrame = imagecreatetruecolor($width, $height);
imagecopy($photoFrame, $background, 0, 0, 0, 0, $width, $height);
imagecopy($photoFrame, $photoFrame2, 0, 0, 0, 0, $width, $height);
imagecopymerge($background, $photoFrame, 0, 0, 0, 0, $width, $height, $amount);
imagedestroy($photoFrame);
return $background;
}
/** Apply a PNG overlay */
function username()
{
$nani = $_SESSION["user"];
if(!empty($_GET['nani']))
{
$nani = $_GET['nani'];
}
$rs_settings = mysqli_query($link,"select * from users where catalogid=$nani");
while ($row_settings = mysql_fetch_array($rs_settings)) {
return $un = strtolower($row_settings['user_name']);
} }
function user()
{
$nani = $_SESSION["user"];
if(!empty($_GET['nani']))
{
$nani = $_GET['nani'];
}
$rs_settings = mysqli_query($link,"select * from users where catalogid=$nani");
while ($row_settings = mysql_fetch_array($rs_settings)) {
return $ca = strtolower($row_settings['catalogname']);
} }
function profilepicture()
{
$nani = $_SESSION["user"];
if(!empty($_GET['nani']))
{
$nani = $_GET['nani'];
}
$rs_settings = mysqli_query($link,"select * from profilepicture where catalogid=$nani");
while ($row_settings = mysql_fetch_array($rs_settings)) {
return $picture = strtolower($row_settings['picture']);
} }
function AppOwner()
{
$AppNo = $_GET['AppNo'];
$rs_settings = mysqli_query($link,"select * from users where catalogid=$AppNo");
while ($row_settings = mysql_fetch_array($rs_settings)) {
return $cat = strtolower($row_settings['catalogname']);
} }
if ($_GET['gratitude'] == "start") {
$uploaddir = 'v/uploads/raw/';
$image ="images/gratitude.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addgratitude($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if ($_GET['gratitude'] == "tshirt") {
$uploaddir = 'v/uploads/raw/';
$image ="images/tshirt.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addtshirt($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if ($_GET['gratitude'] == "hbd") {
$uploaddir = 'v/uploads/raw/';
$image ="images/hbd.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addhbd($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if ($_GET['gratitude'] == "xmas") {
$uploaddir = 'v/uploads/raw/';
$image ="images/xmas.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addxmas($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if ($_GET['gratitude'] == "posted") {
$uploaddir = 'v/uploads/raw/';
$picme = rand(1,6);
if($picme == 1) {
$picture = profilepicture();
if(!empty($picture))
{
$image ="photo/$picture";
}
else
{
$image ="images/bg-1.jpg";
}
}
if($picme == 2) { $image ="images/sky.jpg";}
if($picme == 3) { $image ="images/sunset.jpg";}
if($picme == 4) { $image ="images/sunset2.jpg";}
if($picme == 5) { $image ="images/sunset3.jpg";}
if($picme == 6) { $image ="images/dusk.jpg";}
/*$image ="images/mood/bold.jpg";*/
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$context = $_GET['context'];
$db->updatePost($user,$owner,$AppNo,$nani,$upload,$context);
$pic = $upload;
}
if ($_GET['gratitude'] == "shop") {
$imager = $_GET['imager'];;
$uploaddir = 'v/uploads/raw/';
$image ="elements/$imager";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$newsid = $_GET['newsid'];
$db->addshop($user,$owner,$AppNo,$nani,$upload,$newsid);
$pic = $upload;
$background = $upload;
}
if ($_GET['gratitude'] == "message") {
$uploaddir = 'v/uploads/raw/';
$image ="images/messagea.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addmessage($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if ($_GET['gratitude'] == "thankyou") {
$uploaddir = 'v/uploads/raw/';
$image ="images/gratitude.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addgratitude($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
if (empty($_GET['gratitude']))
{
$pic = $_GET['image'];
}
if ($_GET['message']) {
$uploaddir = 'v/uploads/raw/';
$image ="images/gratitude.jpg";
$date = md5(date('D, d M Y H:i:s'));
$upload = $date.basename($image);
$uploadfile = $uploaddir .$upload;
copy($image,$uploadfile);
$user = user();
$owner = AppOwner();
$AppNo = $_GET['AppNo'];
$nani = $_GET['nani'];
$db->addgratitude($user,$owner,$AppNo,$nani,$upload);
$pic = $upload;
}
/** Check for correct params */
if ($pic && $_GET['filter']) {
if($step=="1")
{
$AppNo = $_GET['AppNo'];
$newsid = $db->base64url_decode($newsid);
$db->mag($pic,$action,$AppNo);
}
if (!empty($_GET['finish']) && $_GET['mag'] =="no" ) {
$AppNo = $_GET['AppNo'];
$db->mag6($pic,$AppNo);
}
if (!empty($_GET['justSave']) && $_GET['mag'] =="naah" ) {
$AppNo = $_GET['AppNo'];
$db->mag6($pic,$AppNo);
exit();
}
if (!empty($_GET['execute']) && $_GET['mag'] =="no" ) {
$AppNo = $_GET['AppNo'];
$db->mag6($pic,$AppNo);
}
if (!empty($_GET['execute']) && $_GET['mag'] =="yes" ) {
$AppNo = $_GET['AppNo'];
$db->mag2($pic,$AppNo);
}
$mag = $_GET['mag'];
$id = substr($pic, 5, 1);gd_filter_image('v/uploads/raw/' . $pic, $_GET['filter']);
if (isset($pic)) {
}
}
/** Apply and deliver the image and clean up */
function gd_filter_image($image_path, $photoFrame2_name)
{
$photoFrame2 = 'gd_filter_' . $photoFrame2_name;
list($width, $height) = getimagesize($image_path);
$size = GetImageSize($image_path);
$mime = $size['mime'];
if (substr($mime, 0, 6) != 'image/')
{
header("Location: ./index.php?mode=photos&msg=requested file is not an accepted type");
exit();
}
$background = imagecreatetruecolor($width, $height);
// Set up the appropriate image handling functions based on the original image's mime type
switch ($size['mime'])
{
case 'image/gif':
// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
// This is maybe not the ideal solution, but IE6 can suck it
$creationFunction = 'ImageCreateFromGif';
$outputFunction = 'ImagePng';
$mime = 'image/png'; // We need to convert GIFs to PNGs
$quality = round(10 - ($quality / 10));
/* if (empty($_GET['execute'])) {$quality = round(10 - (35 / 10));}*/
// We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
break;
case 'image/png':
$quality=100;
$creationFunction = 'ImageCreateFromPng';
$outputFunction = 'ImagePng';
$quality = round(10 - ($quality / 10)); // PNG needs a compression level of 0 (no compression) through 9
/* if (empty($_GET['execute'])) {$quality = round(10 - (35 / 10));}*/
break;
default:
$creationFunction = 'ImageCreateFromJpeg';
$outputFunction = 'ImageJpeg';
$quality=100;
/* if (empty($_GET['execute'])) {$quality = 35;}*/
break;
}
$src = $creationFunction($image_path);
if (in_array($size['mime'], array('image/gif', 'image/png')))
{
if (!$color)
{
// If this is a GIF or a PNG, we need to set up transparency
imagealphablending($background, false);
imagesavealpha($background, true);
}
else
{
// Fill the background with the specified color for matting purposes
if ($color[0] == '#')
$color = substr($color, 1);
$background = FALSE;
if (strlen($color) == 6)
$background = imagecolorallocate($background, hexdec($color[0].$color[1]), hexdec($color[2].$color[3]), hexdec($color[4].$color[5]));
else if (strlen($color) == 3)
$background = imagecolorallocate($background, hexdec($color[0].$color[0]), hexdec($color[1].$color[1]), hexdec($color[2].$color[2]));
if ($background)
imagefill($background, 0, 0, $background);
}
}
$x = $_GET['x'];
$y = $_GET['y'];
if(($x !=0) ||($y !=0)) {
$x = $_GET['x'];
$y = $_GET['y'];
}
else
{
$action = $_GET['filter'];
if($action=="x3"){ $y = -90; $x = -40;}
if($action=="x4"){ $y = -90; $x = -40;}
if($action=="newyear"){ $y = -100; $x = -40;}
if($action=="framemeb"){ $y = -50; $x = -50;}
if($action=="pooh"){ $y = -40; $x = -50;}
if($action=="framed"){ $y = -120; $x = -20;}
if($action=="framec"){ $y = -40; $x = -20;}
if($action=="frameb"){ $y = -50; $x = -20;}
if($action=="framef"){ $y = -30; $x = -20;}
if($action=="merry"){ $y = -30; $x = -20;}
if($action=="colurful"){ $y = -30; $x = -20;}
if($action=="wedding"){ $y = -20; $x = -10;}
if($action=="elegance"){ $y = -30; $x = -20;}
if (empty($y)) { $y = 0; } else { $y = $y; }
if (empty($x)) { $x = 0; } else { $x = $x; }
}
$zoom = $_GET['zoom'];
if (empty($zoom))
{
$zoomheight = $height;
$zoomwidth = $width;
}
else {
$zoomheight = $height + $zoom ;
$zoomwidth = $width + $zoom ;
}
imagecopyresampled($background, $src, 0, 0, $x, $y, $zoomwidth, $zoomheight, $width, $height);
$background = $photoFrame2($background);
if (!empty($_GET['execute'])) {
$outputFunction($background, $image_path, $quality);
}
header("Content-type: $mime");
$outputFunction($background, null, $quality);
imagedestroy($background);
imagedestroy($src);
}
function gd_filter_none($background)
{
return $background;
}
function gd_filter_x1($background) {
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'x1', 100);
return $background;}
function gd_filter_x2($background) {
$background = gd_apply_overlay($background, 'x2', 100);
$background = gd_apply_overlay($background, 'glitter', 100);
return $background;}
function gd_filter_x3($background) {
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'x3', 100);
return $background;}
function gd_filter_x4($background) {
$background = gd_apply_overlay($background, 'x4', 100);
return $background;}
function gd_filter_x5($background) {
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -25);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
/*$background = gd_apply_overlay($background, 'x5', 100);*/
return $background;}
function gd_filter_purpleheaven2($background) {
$background = gd_apply_overlay($background, 'purpleheaven2', 100);
return $background;}
function gd_filter_pooh($background) {
imagefilter($background, IMG_FILTER_BRIGHTNESS, 25);
imagefilter($background, IMG_FILTER_CONTRAST, -25);
imagefilter($background, IMG_FILTER_COLORIZE, 50, 25, -35);
$background = gd_apply_overlay($background, 'pooh', 100);
$background = gd_apply_overlay($background, 'glitter', 100);
return $background;}
function gd_filter_purpleheaven($background) {
$background = gd_apply_overlay($background, 'purpleheaven', 100);
return $background;}
function gd_filter_newyear($background) {
$background = gd_apply_overlay($background, 'newyear', 100);
return $background;}
function gd_filter_framemeb($background) {
$background = gd_apply_overlay($background, 'framemeb', 100);
return $background;}
function gd_filter_frameme($background) {
$background = gd_apply_overlay($background, 'frameme', 100);
return $background;}
function gd_filter_whiteflower($background) {
$background = gd_filter_contrast($background);
$background = gd_apply_overlay($background, 'whiteflower', 100);
return $background;}
function gd_filter_merry($background) {
$background = gd_filter_canvas($background);
$background = gd_apply_overlay($background, 'merry', 100);
return $background;}
function gd_filter_merry2($background) {
$background = gd_filter_contrast($background);
$background = gd_apply_overlay($background, 'merry2', 100);
return $background;}
function gd_filter_colurful($background) {
$background = gd_filter_contrast($background);
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'colurful', 100);
return $background;}
function gd_filter_goldme($background) {
$background = gd_filter_canvas($background);
$background = gd_apply_overlay($background, 'goldme', 100);
return $background;}
function gd_filter_goldbars($background) {
$background = gd_filter_canvas($background);
$background = gd_apply_overlay($background, 'goldbars', 100);
return $background;}
function gd_filter_wedding($background) { imagefilter($background, IMG_FILTER_COLORIZE, 50, 25, -35);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
$background = gd_apply_overlay($background, 'wedding', 100);
return $background;}
function gd_filter_elegance($background) {
$background = gd_filter_contrast($background);
$background = gd_apply_overlay($background, 'elegance', 100);
return $background;}
function gd_filter_goodmorning($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'goodmorning', 100);
return $background;
}
function gd_filter_lol($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'lol', 100);
return $background;
}
function gd_filter_story($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'story', 100);
return $background;
}
function gd_filter_friends($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'friends', 100);
return $background;
}
function gd_filter_kiss3($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'kiss3', 100);
return $background;
}
function gd_filter_awesome($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'awesome', 100);
return $background;
}
function gd_filter_omg($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'omg', 100);
return $background;
}
function gd_filter_love2($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'love2', 100);
return $background;
}
function gd_filter_like($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'like', 100);
return $background;
}
function gd_filter_young($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'young', 100);
return $background;
}
function gd_filter_bored($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'bored', 100);
return $background;
}
function gd_filter_thought($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'thought', 100);
return $background;
}
function gd_filter_babe($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'babe', 100);
return $background;
}
function gd_filter_peace($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'peace', 100);
return $background;
}
function gd_filter_reason($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'reason', 100);
return $background;
}
function gd_filter_famous($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'famous', 100);
return $background;
}
function gd_filter_judge($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'judge', 100);
return $background;
}
function gd_filter_love($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'love', 100);
return $background;
}
function gd_filter_aargh($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'aargh', 100);
return $background;
}
function gd_filter_kiss2($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'kiss2', 100);
return $background;
}
function gd_filter_dope($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'dope', 100);
return $background;
}
function gd_filter_illest($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'illest', 100);
return $background;
}
function gd_filter_boom($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'boom', 100);
return $background;
}
function gd_filter_censored($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'censored', 100);
return $background;
}
function gd_filter_kiss5($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'kiss5', 100);
return $background;
}
function gd_filter_thank($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'thank', 100);
return $background;
}
function gd_filter_lovely($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'lovely', 100);
return $background;
}
function gd_filter_stay($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'stay', 100);
return $background;
}
function gd_filter_kiss($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'kiss', 100);
return $background;
}
function gd_filter_wham($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'wham', 100);
return $background;
}
function gd_filter_grr($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'grr', 100);
return $background;
}
function gd_filter_puff($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'puff', 100);
return $background;
}
function gd_filter_shh($background)
{
$background = gd_apply_overlay($background, 'border', 100);
$background = gd_apply_overlay($background, 'shh', 100);
return $background;
}
function gd_filter_message($background)
{
$background = gd_apply_overlay($background, 'gratitude', 100);
return $background;
}
function gd_filter_gratitude($background)
{
$background = gd_apply_overlay($background, 'gratitude', 100);
return $background;
}
//start frames
function gd_filter_timeless($background)
{
$background = gd_filter_oldschool2($background);
$background = gd_apply_overlay($background, 'timeless', 100);
return $background;
}
function gd_filter_woodframe($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'woodframe', 100);
return $background;
}
function gd_filter_sweetgold($background)
{
$background = gd_filter_canvas($background);
$background = gd_apply_overlay($background, 'sweetgold', 100);
return $background;
}
function gd_filter_multicolor($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'multicolor', 100);
return $background;
}
function gd_filter_sweetflower($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'sweetflower', 100);
return $background;
}
function gd_filter_belle($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'belle', 100);
return $background;
}
function gd_filter_bestwood($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'bestwood', 100);
return $background;
}
function gd_filter_floral($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'floral', 100);
return $background;
}
function gd_filter_redrose($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'redrose', 100);
return $background;
}
function gd_filter_cuteblue($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'cuteblue', 100);
return $background;
}
function gd_filter_goldbaby($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'goldbaby', 100);
return $background;
}
function gd_filter_goldframe($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'goldframe', 100);
return $background;
}
function gd_filter_ornate($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'ornate', 100);
return $background;
}
function gd_filter_shrek($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'shrek', 100);
return $background;
}
function gd_filter_yell($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'yell', 100);
return $background;
}
function gd_filter_goldanddiamonds($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'goldanddiamonds', 100);
return $background;
}
function gd_filter_fire($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'fire', 100);
return $background;
}
function gd_filter_royal($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'royal', 100);
return $background;
}
function gd_filter_ouch($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'ouch', 100);
return $background;
}
function gd_filter_breathtaking($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'breathtaking', 100);
return $background;
}
function gd_filter_simpleclassic($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'simpleclassic', 100);
return $background;
}
function gd_filter_captain($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'captain', 100);
return $background;
}
function gd_filter_woody($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'woody', 100);
return $background;
}
function gd_filter_roughwood($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'roughwood', 100);
return $background;
}
function gd_filter_holdme($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'holdme', 100);
return $background;
}
function gd_filter_seeme($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'seeme', 100);
return $background;
}
function gd_filter_showme($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -10);
$background = gd_apply_overlay($background, 'showme', 100);
return $background;
}
function gd_filter_framea($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'framea', 100);
return $background;
}
function gd_filter_framef($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'framef', 100);
return $background;
}
function gd_filter_frameh($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'frameh', 100);
return $background;
}
function gd_filter_framec($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -15);
imagefilter($background, IMG_FILTER_MEAN_REMOVAL);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
$background = gd_apply_overlay($background, 'canvas', 100);
$background = gd_apply_overlay($background, 'framec', 100);
return $background;
}
function gd_filter_framee($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'framee', 100);
return $background;
}
function gd_filter_framed($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'framed', 100);
return $background;
}
function gd_filter_frameb($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'frameb', 100);
return $background;
}
//end of frames
function gd_filter_leaf($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -30);
$background = gd_apply_overlay($background, 'leaf', 100);
return $background;
}
function gd_filter_heart($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -30);
$background = gd_apply_overlay($background, 'heart', 100);
return $background;
}
function gd_filter_flower($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -30);
$background = gd_apply_overlay($background, 'flower', 100);
return $background;
}
function gd_filter_heart2($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -30);
$background = gd_apply_overlay($background, 'heart2', 100);
return $background;
}
function gd_filter_pink($background)
{
$background = gd_apply_overlay($background, 'pink', 100);
return $background;
}
function gd_filter_sepiaX($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE, -50);
imagefilter($background, IMG_FILTER_COLORIZE,100, 50,0);
/* $width = imagesx($background);
$height = imagesy($background);
for($_x = 0; $_x < $width; $_x++){
for($_y = 0; $_y < $height; $_y++){
$rgb = imagecolorat($background, $_x, $_y);
$r = ($rgb>>16)&0xFF;
$g = ($rgb>>8)&0xFF;
$b = $rgb&0xFF;
$y = $r*0.299 + $g*0.587 + $b*0.114;
$i = 0.15*0xFF;
$q = -0.001*0xFF;
$r = $y + 0.956*$i + 0.621*$q;
$g = $y - 0.272*$i - 0.647*$q;
$b = $y - 1.105*$i + 1.702*$q;
if($r<0||$r>0xFF){$r=($r<0)?0:0xFF;}
if($g<0||$g>0xFF){$g=($g<0)?0:0xFF;}
if($b<0||$b>0xFF){$b=($b<0)?0:0xFF;}
$color = imagecolorallocate($background, $r, $g, $b);
imagesetpixel($background, $_x, $_y, $color);
}
}
*/
return $background;
}
function gd_filter_painting($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
/* $background = gd_apply_overlay($background, 'border', 100);*/
$gaussian = array(
array(-2.0, -1.0, 0.0),
array(-1.0, 1.0, 1.0),
array(0.0, 1.0, 2.0)
);
imageconvolution($background, $gaussian, 1, 5);
$background = gd_apply_overlay($background, 'canvas', 100);
/*$background = gd_apply_overlay($background, 'x7', 100);*/
return $background;
}
function gd_filter_glittzy($background)
{
imagefilter($background, IMG_FILTER_MEAN_REMOVAL);
imagefilter($background, IMG_FILTER_CONTRAST,-50);
return $background;
}
function gd_filter_purpish($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -25);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
imagefilter($background, IMG_FILTER_COLORIZE,217,7,212);
return $background;
}
function gd_filter_elated($background)
{imageconvolution($background,
array(
array(-1, -1, -1),
array(-1, 16, -1),
array(-1, -1, -1)
), 8, 0);
imagefilter($background, IMG_FILTER_COLORIZE,255,153,0,40);
return $background;
}
function gd_filter_ooh($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -25);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
imagefilter($background, IMG_FILTER_COLORIZE,50,-50,50);
if ($_GET['mag'] =="yes" ) { $background = gd_apply_overlay($background, 'glitter', 100);}
return $background;
}
function gd_filter_pinkparadise($background)
{
imageconvolution($background,
array(
array(-1, -1, -1),
array(-1, 16, -1),
array(-1, -1, -1)
), 8, 0);
return $background;
}
function gd_filter_greenparadiseh($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -25);
imagefilter($background, IMG_FILTER_CONTRAST,-20);
imagefilter($background, IMG_FILTER_COLORIZE,100,0,0);
return $background;
}
function gd_filter_batman($background)
{
$background = gd_apply_overlay($background, 'batman', 100);
return $background;
}
function gd_filter_iceage($background)
{
$background = gd_apply_overlay($background, 'iceage', 100);
return $background;
}
function gd_filter_girlie($background)
{
$background = gd_apply_overlay($background, 'girlie', 100);
return $background;
}
function gd_filter_goldenera($background)
{
$background = gd_apply_overlay($background, 'goldenera', 100);
return $background;
}
function gd_filter_creative($background)
{
$background = gd_apply_overlay($background, 'creative', 100);
return $background;
}
function gd_filter_wonder($background)
{
$background = gd_apply_overlay($background, 'wonder', 100);
return $background;
}
function gd_filter_classic($background)
{
$background = gd_apply_overlay($background, 'classic', 100);
return $background;
}
function gd_filter_red($background)
{
$background = gd_apply_overlay($background, 'red', 100);
return $background;
}
function gd_filter_lady($background)
{
$background = gd_apply_overlay($background, 'lady', 100);
return $background;
}
function gd_filter_red2($background)
{
$background = gd_apply_overlay($background, 'red2', 100);
return $background;
}
function gd_filter_red3($background)
{
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'red3', 100);
return $background;
}
function gd_filter_tshirt($background)
{
$font = 'assets/fonts/Lover.otf'; //font used
$facebook_blue3 = imagecolorallocate($background, 255,255,255); // Create blue color
$txt_user_name2 = user();
imagealphablending($background, true); //bring back alpha blending for transperent font
imagettftext($background, 60, 0, 150, 200, $facebook_blue3, $font, $txt_user_name2.",");
return $background;
}
//posted
function gd_filter_bold($background)
{
/* $background = imagecreate( 500, 500 );
$light_blue = imagecolorallocate( $background, 255, 255, 255 );*/
$fontX = 'assets/fonts/ChopinScript.otf'; //font used
$facebook_blue = imagecolorallocate($background, 255, 255, 255); // Create blue color
imagefilter($background, IMG_FILTER_BRIGHTNESS, -65);
$text = wordwrap($_GET['context'],30,"\n");
$font_size = 1;
$txt_max_width = intval(0.9*500);
do{
$font_size++;
$p = imagettfbbox($font_size,0,$fontX,$text);
$txt_width = $p[2] - $p[0];
$txt_height = $p[1] - $p[7];
}
while (($txt_width <= $txt_max_width) && ($font_size <= 40)) ;
//now center text
$y = (500 - $txt_height) / 2;
$x = (500 - $txt_width) / 2;
imagettftext($background,$font_size, 0, $x, $y, $facebook_blue, $fontX, $text); //Write name to id card
$font = 'assets/fonts/Exo2.0-Bold_0.otf'; //font used
$facebook_blue2 = imagecolorallocate($background, 255, 255, 255);
// Create blue color
$txt_user_name = ucwords(user());
imagealphablending($background, true); //bring back alpha blending for transperent font
/*imagettftext($background, 30, 0, 25,50, $facebook_blue2, $font, $txt_user_name); *///Write name to id card
return $background;
}
function gd_filter_hbd($background)
{
$font = 'assets/fonts/Lover.otf'; //font used
$facebook_blue4 = imagecolorallocate($background, 106,192,189); // Create blue color
$facebook_blue3 = imagecolorallocate($background, 193,73,78); // Create blue color
$txt_user_name2 = user();
$txt_user_name3 = AppOwner();
imagealphablending($background, true); //bring back alpha blending for transperent font
imagettftext($background, 50, 0, 180, 210, $facebook_blue3, $font, $txt_user_name2);
imagettftext($background, 60, 0, 350, 400, $facebook_blue4, $font, $txt_user_name3);
return $background;
}
function gd_filter_xmas($background)
{
$font = 'assets/fonts/Lover.otf'; //font used
$facebook_blue4 = imagecolorallocate($background, 150,0,0); // Create blue color
$facebook_blue3 = imagecolorallocate($background, 193,73,78); // Create blue color
$txt_user_name2 = user();
$txt_user_name3 = AppOwner();
imagealphablending($background, true); //bring back alpha blending for transperent font
/* imagettftext($background, 50, 0, 180, 210, $facebook_blue3, $font, $txt_user_name2); */
imagettftext($background, 60, 0, 190, 380, $facebook_blue4, $font, $txt_user_name3);
return $background;
}
/** Apply 'Cartoonise' preset */
function gd_filter_comic($background)
{
/*
*/
imagefilter($background, IMG_FILTER_MEAN_REMOVAL);
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 15);
imagefilter($background, IMG_FILTER_CONTRAST, -40);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 10);
imagefilter($background, IMG_FILTER_SELECTIVE_BLUR);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 30);
imagefilter($background, IMG_FILTER_CONTRAST, -100);
$matrix = array(
array(-1, -2, -1),
array(-2, 16, -2),
array(-1, -2, -1),
);
$divisor = array_sum(array_map('array_sum', $matrix));
$offset =0;
imageconvolution($background, $matrix, $divisor, $offset);
imagefilter($background, IMG_FILTER_SMOOTH, 2);
$background = gd_apply_overlay($background, 'canvas', 100);
return $background;
}
/** Apply 'Cartoonise' preset */
function gd_filter_cartoon($background)
{
/*
*/
imagefilter($background, IMG_FILTER_EDGEDETECT);
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 10);
imagefilter($background, IMG_FILTER_CONTRAST, -40);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 10);
imagefilter($background, IMG_FILTER_SELECTIVE_BLUR);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 100);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
$background = gd_apply_overlay($background, 'canvas', 100);
$matrix = array(
array(-1, -1, -1),
array(-1, 16, -1),
array(-1, -1, -1),
);
$divisor = array_sum(array_map('array_sum', $matrix));
$offset = 0;
imageconvolution($background, $matrix, $divisor, $offset);
imagefilter($background, IMG_FILTER_SMOOTH, 3);
return $background;
}
/** Apply 'Red' preset */
function gd_filter_excite($background)
{
imagefilter($background, IMG_FILTER_COLORIZE ,0, -155, -255);
if ($_GET['mag'] =="yes" ) { $background = gd_apply_overlay($background, 'glitter', 100);}
return $background;
}
/** Apply 'Purple' preset */
function gd_filter_purple($background)
{
imagefilter($background, IMG_FILTER_COLORIZE, 0, 0, 100);
if ($_GET['mag'] =="yes" ) { $background = gd_filter_cosmopolitan($background);}
return $background;
}
function gd_filter_purple3($background)
{
$background = gd_apply_overlay($background, 'purple', 100);
return $background;
}
/** Apply 'Contrast' preset */
function gd_filter_contrast($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 8);
imagefilter($background, IMG_FILTER_CONTRAST, -8);
return $background;
}
function gd_filter_cool($background){
$background = gd_apply_overlay($background, 'cool', 100);
return $background;
}
function gd_filter_floresa($background)
{
$background = gd_apply_overlay($background, 'floresa', 100);
return $background;
}
function gd_filter_floresb($background)
{
$background = gd_apply_overlay($background, 'floresb', 100);
return $background;
}
function gd_filter_floresc($background)
{
$background = gd_apply_overlay($background, 'floresc', 100);
return $background;
}
function gd_filter_florese($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
$background = gd_apply_overlay($background, 'florese', 100);
$background = gd_apply_overlay($background, 'glitter', 100);
return $background;
}
function gd_filter_haute($background)
{
$background = gd_apply_overlay($background, 'haute', 100);
return $background;
}
function gd_filter_oppulence($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -15);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'oppulence', 100);
return $background;
}
function gd_filter_floresd($background)
{
$background = gd_apply_overlay($background, 'floresd', 100);
return $background;
}
function gd_filter_fake($background){
$background = gd_apply_overlay($background, 'fake', 100);
return $background;
}
function gd_filter_mc($background){
$background = gd_apply_overlay($background, 'mc', 100);
return $background;
}
function gd_filter_ms($background){
$background = gd_apply_overlay($background, 'ms', 100);
return $background;
}
function gd_filter_si($background)
{
$background = gd_apply_overlay($background, 'si', 100);
return $background;
}
function gd_filter_teenvogue($background)
{
$background = gd_apply_overlay($background, 'teenvogue', 100);
return $background;
}
function gd_filter_wired($background)
{
$background = gd_apply_overlay($background, 'wired', 100);
return $background;
}
function gd_filter_vibe($background)
{
$background = gd_apply_overlay($background, 'vibe', 100);
return $background;
}
function gd_filter_people($background)
{
$background = gd_apply_overlay($background, 'people', 100);
return $background;
}
function gd_filter_allure($background)
{
$background = gd_apply_overlay($background, 'allure', 100);
return $background;
}
function gd_filter_bazaar($background)
{
$background = gd_apply_overlay($background, 'bazaar', 100);
return $background;
}
function gd_filter_vogue($background)
{
$background = gd_apply_overlay($background, 'vogue', 100);
return $background;
}
function gd_filter_glamour($background)
{
$background = gd_apply_overlay($background, 'glamour', 100);
return $background;
}
function gd_filter_fortune($background)
{
$background = gd_apply_overlay($background, 'fortune', 100);
return $background;
}
function gd_filter_elle($background)
{
$background = gd_apply_overlay($background, 'elle', 100);
return $background;
}
function gd_filter_cosmopolitan($background)
{
$background = gd_apply_overlay($background, 'cosmopolitan', 100);$background = gd_apply_overlay($background, 'glitter', 100);
return $background;
}
function gd_filter_bloomberg($background)
{
$background = gd_apply_overlay($background, 'bloomberg', 100);
return $background;
}
function gd_filter_economist($background)
{
$background = gd_apply_overlay($background, 'economist', 100);
return $background;
}
function gd_filter_fresh($background)
{
$background = gd_apply_overlay($background, 'fresh', 100);
return $background;
}
function gd_filter_abstract($background)
{
$background = gd_apply_overlay($background, 'abstract', 100);
return $background;
}
function gd_filter_fresh3($background)
{
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'fresh3', 100);
return $background;
}
function gd_filter_fresh5($background)
{
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'fresh5', 100);
return $background;
}
function gd_filter_fresh2($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 25);
imagefilter($background, IMG_FILTER_CONTRAST, -25);
imagefilter($background, IMG_FILTER_COLORIZE, 50, 25, -35);
$background = gd_apply_overlay($background, 'fresh2', 100);
$background = gd_apply_overlay($background, 'glitter', 100);
return $background;
}
function gd_filter_fresh4($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'glitter', 100);
$background = gd_apply_overlay($background, 'fresh', 100);
return $background;
}
function gd_filter_time($background)
{
$background = gd_apply_overlay($background, 'time', 100);
return $background;
}
/** Apply 'Blue Velvet' preset */
function gd_filter_velvet($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
imagefilter($background, IMG_FILTER_CONTRAST, -25);
imagefilter($background, IMG_FILTER_COLORIZE, -10, 45, 65);
/* $background = gd_apply_overlay($background, 'noise', 45);
$background = gd_apply_overlay($background, 'vignette', 100);*/
return $background;
}
/** Apply 'Chrome' preset */
function gd_filter_chrome($background)
{
/* imagefilter($background, IMG_FILTER_BRIGHTNESS, 15);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
imagefilter($background, IMG_FILTER_COLORIZE, -5, -10, -15);
$background = gd_apply_overlay($background, 'noise', 45);*/
$background = gd_apply_overlay($background, 'luxury', 100);
return $background;
}
/** Apply 'Chrome' preset */
function gd_filter_rainbowa($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 25);
imagefilter($background, IMG_FILTER_CONTRAST, -25);
imagefilter($background, IMG_FILTER_COLORIZE, 50, 25, -35);
/* $background = gd_apply_overlay($background, 'rainbowa', 100);*/
return $background;
}
/** Apply 'Lift' preset */
function gd_filter_lift($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -25);
/*imagefilter($background, IMG_FILTER_COLORIZE, 75, 0, 25);*/
/*$background = gd_apply_overlay($background, 'emulsion', 100);*/
return $background;
}
/** Apply 'Canvas' preset */
function gd_filter_canvas($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 25);
imagefilter($background, IMG_FILTER_CONTRAST, -25);
imagefilter($background, IMG_FILTER_COLORIZE, 50, 25, -35);
$background = gd_apply_overlay($background, 'canvas', 100);
return $background;
}
/** Apply 'Canvas' preset */
function gd_filter_tiltshift($background)
{
$percent_x=0.5;
$percent_y=0.5;
$padding_x=0.3;
$padding_y =0.0;
$im = 'v/uploads/raw/'.$_GET["image"];
list($width, $height) = getimagesize($im);
$background = imagecreatefromjpeg($im);
$crop = imagecreatefromjpeg($im);
//Set new crop dimensions
$new_width = $width*$percent_x;
$new_height = $height*$percent_y;
//New crop position within original image
$newx = $width*$padding_x;
$newy = $height*$padding_y;
//Blur the hell out of the original image
imagefilter($background, IMG_FILTER_SELECTIVE_BLUR);
imagefilter($background, IMG_FILTER_GAUSSIAN_BLUR);
//Position crop on top of the original image
imagecopyresampled($background, $crop, $newx, $newy, $newx, $newy, $new_width, $new_height,$new_width, $new_height);
//Add a dash of contrast to the new merge
imagefilter($background, IMG_FILTER_CONTRAST, -10);
return $background;
}
/** Apply 'Canvas' preset */
function gd_filter_golden($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -40) ;
$sharpMatrix = array
(
array(0, -1, 0),
array(-1, 5, -1),
array(0, -1, 0)
);
$divisor = array_sum(array_map('array_sum', $sharpMatrix));
$offset = 0;
imageconvolution($background, $sharpMatrix, $divisor, $offset);
return $background;
}
//start of cards
function gd_filter_whiteheart($background)
{
$background = gd_apply_overlay($background, 'whiteheart', 100);
return $background;
}
function gd_filter_goldbow($background)
{
$background = gd_apply_overlay($background, 'goldbow', 100);
return $background;
}
function gd_filter_kidparadise($background)
{
$background = gd_apply_overlay($background, 'kidparadise', 100);
return $background;
}
function gd_filter_criaca($background)
{
$background = gd_apply_overlay($background, 'criaca', 100);
return $background;
}
function gd_filter_nothingbutlove($background)
{
$background = gd_apply_overlay($background, 'nothingbutlove', 100);
return $background;
}
function gd_filter_pearlroses($background)
{
$background = gd_apply_overlay($background, 'pearlroses', 100);
return $background;
}
function gd_filter_pinkglory($background)
{
$background = gd_apply_overlay($background, 'pinkglory', 100);
return $background;
}
function gd_filter_cute($background)
{
$background = gd_apply_overlay($background, 'cute', 100);
return $background;
}
function gd_filter_tomandjerry($background)
{
$background = gd_apply_overlay($background, 'tomandjerry', 100);
return $background;
}
function gd_filter_streetme($background)
{
$background = gd_apply_overlay($background, 'streetme', 100);
return $background;
}
function gd_filter_billboardme($background)
{
$background = gd_apply_overlay($background, 'billboardme', 100);
return $background;
}
function gd_filter_display($background)
{
$background = gd_apply_overlay($background, 'display', 100);
return $background;
}
function gd_filter_coolme($background)
{
$background = gd_apply_overlay($background, 'coolme', 100);
return $background;
}
function gd_filter_wall($background)
{
$background = gd_apply_overlay($background, 'wall', 100);
return $background;
}
function gd_filter_citycenter($background)
{
$background = gd_apply_overlay($background, 'citycenter', 100);
return $background;
}
function gd_filter_standby($background)
{
$background = gd_apply_overlay($background, 'standby', 100);
return $background;
}
function gd_filter_livingroom($background)
{
$background = gd_apply_overlay($background, 'livingroom', 100);
return $background;
}
function gd_filter_purity($background)
{
$background = gd_apply_overlay($background, 'purity', 100);
return $background;
}
//end of cards
//print her
function gd_filter_print($background)
{
/*imagefilter($background, IMG_FILTER_BRIGHTNESS, -30);*/
$background = gd_apply_overlay($background, 'print', 100);
/*$gaussian = array(
array(1.0, 1.0, 1.0),
array(1.0, -7.0, 1.0),
array(1.0, 1.0, 1.0)
);
imageconvolution($background, $gaussian, 1, 4);*/
/* blurr $gaussian = array(
array(1.0, 1.0, 1.0),
array(1.0, 1.0, 1.0),
array(1.0, 1.0, 1.0)
);
imageconvolution($background, $gaussian, 9, 20);*/
return $background;
}
function gd_filter_1print($background)
{
$background = gd_apply_overlay($background, '1print', 100);
return $background;
}
function gd_filter_2print($background)
{
$background = gd_apply_overlay($background, '2print', 100);
return $background;
}
function gd_filter_3print($background)
{
$background = gd_apply_overlay($background, '3print', 100);
return $background;
}
function gd_filter_4print($background)
{
$background = gd_apply_overlay($background, '4print', 100);
return $background;
}
function gd_filter_5print($background)
{
$background = gd_apply_overlay($background, '5print', 100);
return $background;
}
function gd_filter_6print($background)
{
$background = gd_apply_overlay($background, '6print', 100);
return $background;
}
function gd_filter_7print($background)
{
$background = gd_apply_overlay($background, '7print', 100);
return $background;
}
function gd_filter_8print($background)
{
$background = gd_apply_overlay($background, '8print', 100);
return $background;
}
function gd_filter_9print($background)
{
$background = gd_apply_overlay($background, '9print', 100);
return $background;
}
function gd_filter_10print($background)
{
$background = gd_apply_overlay($background, '10print', 100);
return $background;
}
function gd_filter_11print($background)
{
$background = gd_apply_overlay($background, '11print', 100);
return $background;
}
function gd_filter_12print($background)
{
$background = gd_apply_overlay($background, '12print', 100);
return $background;
}
function gd_filter_13print($background)
{
$background = gd_apply_overlay($background, '13print', 100);
return $background;
}
function gd_filter_14print($background)
{
$background = gd_apply_overlay($background, '14print', 100);
return $background;
}
function gd_filter_15print($background)
{
$background = gd_apply_overlay($background, '15print', 100);
return $background;
}
function gd_filter_16print($background)
{
$background = gd_apply_overlay($background, '16print', 100);
return $background;
}
function gd_filter_17print($background)
{
$background = gd_apply_overlay($background, '17print', 100);
return $background;
}
function gd_filter_18print($background)
{
$background = gd_apply_overlay($background, '18print', 100);
return $background;
}
function gd_filter_19print($background)
{
$background = gd_apply_overlay($background, '19print', 100);
return $background;
}
function gd_filter_20print($background)
{
$background = gd_apply_overlay($background, '20print', 100);
return $background;
}
function gd_filter_21print($background)
{
$background = gd_apply_overlay($background, '21print', 100);
return $background;
}
function gd_filter_22print($background)
{
$background = gd_apply_overlay($background, '22print', 100);
return $background;
}
function gd_filter_23print($background)
{
$background = gd_apply_overlay($background, '23print', 100);
return $background;
}
function gd_filter_24print($background)
{
$background = gd_apply_overlay($background, 'pinkglory', 100);
return $background;
}
function gd_filter_25print($background)
{
$background = gd_apply_overlay($background, '25print', 100);
return $background;
}
function gd_filter_26print($background)
{
$background = gd_apply_overlay($background, '26print', 100);
return $background;
}
function gd_filter_27print($background)
{
$background = gd_apply_overlay($background, '27print', 100);
return $background;
}
function gd_filter_28print($background)
{
$background = gd_apply_overlay($background, '28print', 100);
return $background;
}
function gd_filter_29print($background)
{
$background = gd_apply_overlay($background, '29print', 100);
return $background;
}
function gd_filter_30print($background)
{
$background = gd_apply_overlay($background, '30print', 100);
return $background;
}
function gd_filter_31print($background)
{
$background = gd_apply_overlay($background, '31print', 100);
return $background;
}
function gd_filter_32print($background)
{
$background = gd_apply_overlay($background, '32print', 100);
return $background;
}
function gd_filter_33print($background)
{
$background = gd_apply_overlay($background, '33print', 100);
return $background;
}
function gd_filter_34print($background)
{
$background = gd_apply_overlay($background, '34print', 100);
return $background;
}
function gd_filter_35print($background)
{
$background = gd_apply_overlay($background, '35print', 100);
return $background;
}
function gd_filter_36print($background)
{
$background = gd_apply_overlay($background, '36print', 100);
return $background;
}
function gd_filter_37print($background)
{
$background = gd_apply_overlay($background, '37print', 100);
return $background;
}
function gd_filter_38print($background)
{
$background = gd_apply_overlay($background, '38print', 100);
return $background;
}
function gd_filter_39print($background)
{
$background = gd_apply_overlay($background, '39print', 100);
return $background;
}
function gd_filter_40print($background)
{
$background = gd_apply_overlay($background, '41print', 100);
return $background;
}
function gd_filter_42print($background)
{
$background = gd_apply_overlay($background, '42print', 100);
return $background;
}
function gd_filter_43print($background)
{
$background = gd_apply_overlay($background, '3print', 100);
return $background;
}
function gd_filter_44print($background)
{
$background = gd_apply_overlay($background, '44print', 100);
return $background;
}
function gd_filter_45print($background)
{
$background = gd_apply_overlay($background, '45print', 100);
return $background;
}
function gd_filter_46print($background)
{
$background = gd_apply_overlay($background, '46print', 100);
return $background;
}
function gd_filter_47print($background)
{
$background = gd_apply_overlay($background, '47print', 100);
return $background;
}
function gd_filter_coke($background) {
$background = gd_apply_overlay($background, 'coke', 100);
return $background;}
function gd_filter_coke2($background) {
$background = gd_apply_overlay($background, 'coke2', 100);
return $background;}
function gd_filter_coke3($background) {
$background = gd_apply_overlay($background, 'coke3', 100);
return $background;}
function gd_filter_coke4($background) {
$background = gd_apply_overlay($background, 'coke4', 100);
return $background;}
function gd_filter_coke5($background) {
$background = gd_apply_overlay($background, 'coke5', 100);
return $background;}
function gd_filter_coke6($background) {
$background = gd_apply_overlay($background, 'coke6', 100);
return $background;}
function gd_filter_coke7($background) {
$background = gd_apply_overlay($background, 'coke7', 100);
return $background;}
function gd_filter_48print($background)
{
$background = gd_apply_overlay($background, '48print', 100);
return $background;
}
function gd_filter_49print($background)
{
$background = gd_apply_overlay($background, '49print', 100);
return $background;
}
/** Apply 'Vintage 600' preset */
function gd_filter_vintage($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -15);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
/*$background = gd_apply_overlay($background, 'vintage', 100);*/
return $background;
}
/** Apply 'Monopin' preset */
function gd_filter_oldschool($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'vignette', 100);
return $background;
}
/** Apply 'Monopin' preset */
function gd_filter_oldschool2($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 5);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
$background = gd_apply_overlay($background, 'emulsion', 100);
return $background;
}
/** Apply 'Antique' preset */
function gd_filter_antique($background)
{
imagefilter($background, IMG_FILTER_BRIGHTNESS, 0);
imagefilter($background, IMG_FILTER_CONTRAST, -30);
imagefilter($background, IMG_FILTER_COLORIZE, 75, 50, 25);
return $background;
}
/** Apply 'Black & White' preset */
function gd_filter_blackwhite($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, 10);
imagefilter($background, IMG_FILTER_CONTRAST, -20);
return $background;
}
/** Apply 'Colour Boost' preset */
function gd_filter_boost($background)
{
imagefilter($background, IMG_FILTER_CONTRAST, -35);
imagefilter($background, IMG_FILTER_COLORIZE, 25, 25, 25);
return $background;
}
/** Apply 'Sepia' preset */
function gd_filter_sepia($background)
{
imagefilter($background, IMG_FILTER_GRAYSCALE);
imagefilter($background, IMG_FILTER_BRIGHTNESS, -10);
imagefilter($background, IMG_FILTER_CONTRAST, -20);
imagefilter($background, IMG_FILTER_COLORIZE, 60, 30, -15);
return $background;
}
/** Apply 'Partial blur' preset */
function gd_filter_blur($background)
{
imagefilter($background, IMG_FILTER_SELECTIVE_BLUR);
imagefilter($background, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($background, IMG_FILTER_CONTRAST, -15);
imagefilter($background, IMG_FILTER_SMOOTH, -2);
return $background;
}