<?php
 class phMagick_convert{ function convert(phmagick $p){ $cmd = $p->getBinary('convert'); $cmd .= ' -quality ' . $p->getImageQuality(); $cmd .= ' "' . $p->getSource() .'"  "'. $p->getDestination().'"'; $p->execute($cmd); $p->setSource($p->getDestination()); $p->setHistory($p->getDestination()); return $p ; } function save(phmagick $p){ return $p->convert($p); } } ?>