Initial import: Carteasy Shop (Dev-Stand)
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
|
||||
abstract class phImaginator_Merge extends phImaginator_Universal implements phImaginator_Module {
|
||||
|
||||
|
||||
protected static $runCollected = true;
|
||||
|
||||
|
||||
public static function fitted($params) {
|
||||
require_once 'phImaginator.Box.class.php';
|
||||
|
||||
self::universalMerger('fitted', $params);
|
||||
}
|
||||
|
||||
|
||||
private static function universalMerger($type, $params) {
|
||||
$width = $params[0];
|
||||
$height = $params[1];
|
||||
|
||||
$lucency = ($params[2]) ? $params[2] : 50;
|
||||
|
||||
if (is_array(parent::$imageSourceCollection)) {
|
||||
|
||||
$mergedImage = imagecreatetruecolor($width, $height);
|
||||
|
||||
$iteratorCnt = 0;
|
||||
|
||||
foreach (parent::$imageSourceCollection as $image_data) {
|
||||
if ($type == 'fitted') {
|
||||
phImaginator_Box::fit($image_data, array($width, $height));
|
||||
}
|
||||
|
||||
$useLucency = (++$iteratorCnt > 1) ? $lucency : 100;
|
||||
|
||||
imagecopymerge($mergedImage, $image_data['resource'], 0, 0, 0, 0, $image_data['width'], $image_data['height'], $useLucency);
|
||||
}
|
||||
|
||||
parent::replaceSourceCollection($mergedImage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user