3 class File_Convert_Solution_convert extends File_Convert_Solution
10 'from' => array( //source
15 'to' => array( //target
26 function convert($fn,$x,$y,$pg) // image only..
31 $target = $fn . '.' . $ext;
33 $this->debug("COVERT: FE:" . (file_exists($target) ? 1: 0) );
34 $this->debug("COVERT: FS:" . (file_exists($target) ? (filemtime($target) . '>' . filemtime($fn)) : 'n/a'));
36 if (file_exists($target) && filesize($target) && filemtime($target) > filemtime($fn)) {
40 $targetName = $target;
41 if ($this->to == 'image/jpeg' && $this->from != 'image/gif') {
42 $flat = " -background '#ffffff' --flatten ";
45 if ($this->to == 'image/x-ms-bmp') {
46 $targetName = "bmp3:$target";
49 if ($this->from == 'image/gif') {
53 require_once 'System.php';
54 $CONVERT = System::which("convert");
55 $cmd = "$CONVERT " . $strip . " -colorspace sRGB -interlace none -density 800 $flat ".
56 "-quality 90 ". escapeshellarg($fn . $frame) . " " . escapeshellarg($targetName );
60 $fe = file_exists($target) && filesize($target) ? $target : false;
65 @chmod($target,fileperms($fn));