//echo "testing scale image";
require_once 'File/Convert/Solution/scaleimage.php';
- $sc = new File_Convert_Solution_scaleimage($toMimetype, $toMimetype);
+ $sc = new File_Convert_Solution_scaleimage($toMimetype, $toMimetype, self::$options);
//$sc->convert = $this;
$sc->debug= $this->debug;
$this->solutions[] = $sc;
require_once 'File/Convert/Solution/'. $scf . '.php';
$scls = 'File_Convert_Solution_' . $scf;
- $sc = new $scls($toMimetype, $toMimetype);
+ $sc = new $scls($toMimetype, $toMimetype, self::$options);
$sc->debug= $this->debug;
$this->solutions[] = $sc;
$x = str_replace('c', 'x', $x);
class File_Convert_Solution
{
+ static $options = array();
var $type = 0;
var $from; // mimetype
var $to; // mimetype
var $cmd;
- function __construct( $from ,$to)
+ function __construct( $from ,$to, $options=array())
{
$this->from = $from;
require_once 'File/MimeType.php';
$mt = new File_MimeType();
$this->ext = $mt->toExt($this->to);
+
+ self::$options = $options;
//$this->last = $this; //?? used where?
$scale = '';
$define = '';
}
- $extent ="-extent '{$x}x{$y}>' -gravity center -background white {$define}";
+
+ $extent ="-extent '{$x}x{$y}>' -gravity center " .
+ (
+ (!empty(self::$options['transparent_background'])) ?
+ "-transparent white" :
+ "-background white"
+ ) .
+ " {$define}";
break;
}