Exemplo n.º 1
0
 /**
  * (non-PHPdoc)
  * @see WideImage_Image#getChannels()
  */
 function getChannels()
 {
     $args = func_get_args();
     if (count($args) == 1 && is_array($args[0])) {
         $args = $args[0];
     }
     return WideImage_OperationFactory::get('CopyChannelsPalette')->execute($this, $args);
 }
Exemplo n.º 2
0
 /**
  * Used internally to create Operation objects
  *
  * @param string $name
  * @return object
  */
 protected function getOperation($name)
 {
     return WideImage_OperationFactory::get($name);
 }
Exemplo n.º 3
0
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
        
    WideImage is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.
        
    You should have received a copy of the GNU Lesser General Public License
    along with WideImage; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    
    * @package Tests
  **/
WideImage_OperationFactory::get('Resize');
class WideImage_Operation_Resize_Testable extends WideImage_Operation_Resize
{
    function prepareDimensions($img, $width, $height, $fit)
    {
        return parent::prepareDimensions($img, $width, $height, $fit);
    }
}
/**
 * @package Tests
 */
class WideImage_Operation_Resize_Test extends WideImage_TestCase
{
    function testProxyMethod()
    {
        $op = $this->getMock('WideImage_Operation_Resize', array('execute'));
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
		
    WideImage is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.
		
    You should have received a copy of the GNU Lesser General Public License
    along with WideImage; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    
    * @package Tests
  **/
WideImage_OperationFactory::get('ResizeCanvas');
/**
 * @package Tests
 */
class WideImage_Operation_ResizeCanvas_Test extends WideImage_TestCase
{
    function testResizeCanvasUp()
    {
        $img = WideImage::createTrueColorImage(160, 120);
        $resized = $img->resizeCanvas(180, 180, 0, 0);
        $this->assertDimensions($resized, 180, 180);
    }
    function testResizeCanvasDown()
    {
        $img = WideImage::createTrueColorImage(160, 120);
        $resized = $img->resizeCanvas(30, 100, 0, 0);
 public function testUserDefinedOp()
 {
     $op = WideImage_OperationFactory::get('MyOperation');
     $this->assertTrue($op instanceof WideImage_Operation_MyOperation);
 }