Initial import: Carteasy Shop (Dev-Stand)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
abstract class phImaginator_Rotate extends phImaginator_Universal implements phImaginator_Module {
|
||||
|
||||
protected static $runCollected = false;
|
||||
|
||||
|
||||
public static function degree($angle, $color = '#000000', $opacity = 100) {
|
||||
$image_data =& parent::getCurrentResource();
|
||||
|
||||
$bgcolor = parent::transparency($image_data['resource'], $color, $opacity);
|
||||
|
||||
$image_data['resource'] = imagerotate($image_data['resource'], $angle, $bgcolor, true);
|
||||
|
||||
$image_data['width'] = imagesx($image_data['resource']);
|
||||
$image_data['height'] = imagesy($image_data['resource']);
|
||||
}
|
||||
|
||||
|
||||
public static function landscape() {
|
||||
$image_data =& parent::getCurrentResource();
|
||||
|
||||
if ($image_data['width'] < $image_data['height']) {
|
||||
self::degree(270);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function portrait() {
|
||||
$image_data =& parent::getCurrentResource();
|
||||
|
||||
if ($image_data['width'] > $image_data['height']) {
|
||||
self::degree(90);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user