当前位置: 首页>>代码示例>>PHP>>正文


PHP WideImage::path方法代码示例

本文整理汇总了PHP中WideImage::path方法的典型用法代码示例。如果您正苦于以下问题:PHP WideImage::path方法的具体用法?PHP WideImage::path怎么用?PHP WideImage::path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WideImage的用法示例。


在下文中一共展示了WideImage::path方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: path

 /**
  * Returns the path to the library
  *
  * @return string
  */
 static function path()
 {
     if (self::$path === null) {
         self::$path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
     }
     return self::$path;
 }
开发者ID:google-code-backups,项目名称:rsslounge,代码行数:12,代码来源:WideImage.php

示例2: get

 static function get($operationName)
 {
     if (!isset(self::$cache[$operationName])) {
         $opClassName = "WideImage_Operation_" . $operationName;
         if (!class_exists($opClassName, false)) {
             $fileName = WideImage::path() . 'Operation/' . $operationName . '.php';
             if (file_exists($fileName)) {
                 require_once $fileName;
             } else {
                 throw new WideImage_UnknownImageOperationException("Can't load '{$operationName}' operation.");
             }
         }
         self::$cache[$operationName] = new $opClassName();
     }
     return self::$cache[$operationName];
 }
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:16,代码来源:OperationFactory.php

示例3: get

 public static function get($operationName)
 {
     $lcname = strtolower($operationName);
     if (!isset(self::$cache[$lcname])) {
         $opClassName = 'WideImage_Operation_' . ucfirst($operationName);
         if (!class_exists($opClassName, false)) {
             $fileName = WideImage::path() . 'Operation/' . ucfirst($operationName) . '.php';
             if (file_exists($fileName)) {
                 require_once $fileName;
             } elseif (!class_exists($opClassName)) {
                 throw new WideImage_UnknownImageOperationException("Can't load '{$operationName}' operation.");
             }
         }
         self::$cache[$lcname] = new $opClassName();
     }
     return self::$cache[$lcname];
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:17,代码来源:OperationFactory.php

示例4: selectMapper

 /**
  * Returns a mapper, based on the $uri and $format
  * 
  * @param string $uri File URI
  * @param string $format File format (extension or mime-type) or null
  * @return WideImage_Mapper
  **/
 static function selectMapper($uri, $format = null)
 {
     $format = self::determineFormat($uri, $format);
     if (array_key_exists($format, self::$mappers)) {
         return self::$mappers[$format];
     }
     $mapperClassName = 'WideImage_Mapper_' . $format;
     if (!class_exists($mapperClassName, false)) {
         $mapperFileName = WideImage::path() . 'Mapper/' . $format . '.php';
         if (file_exists($mapperFileName)) {
             require_once $mapperFileName;
         }
     }
     if (class_exists($mapperClassName)) {
         self::$mappers[$format] = new $mapperClassName();
         return self::$mappers[$format];
     }
     throw new WideImage_UnsupportedFormatException("Format '{$format}' is not supported.");
 }
开发者ID:ehazell,项目名称:AWPF,代码行数:26,代码来源:MapperFactory.php

示例5: load

<?php

/**
 * @author Gasper Kozak
 * @copyright 2007-2011
 **/
include_once WideImage::path() . '/vendor/de77/TGA.php';
/**
 * Mapper support for TGA.
 */
class WideImage_Mapper_TGA
{
    public function load($uri)
    {
        return WideImage_vendor_de77_TGA::imagecreatefromtga($uri);
    }
    public function loadFromString($data)
    {
        return WideImage_vendor_de77_TGA::imagecreatefromstring($data);
    }
    public function save($handle, $uri = null)
    {
        throw new WideImage_Exception("Saving to TGA isn't supported.");
    }
}
开发者ID:dongilbert,项目名称:mautic,代码行数:25,代码来源:TGA.php

示例6: setup

<?php

/**
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

     **/
include WideImage::path() . 'Mapper/GD.php';
class WideImage_Mapper_GD_Test extends WideImage_TestCase
{
    /**
     * @var WideImage_Mapper_GD
     */
    protected $mapper;
    public function setup()
    {
        $this->mapper = WideImage_MapperFactory::selectMapper(null, 'gd');
    }
    public function teardown()
    {
        $this->mapper = null;
        if (file_exists(IMG_PATH . 'temp/test.gd')) {
            unlink(IMG_PATH . 'temp/test.gd');
        }
    }
    public function testSaveAndLoad()
    {
        $handle = imagecreatefromgif(IMG_PATH . '100x100-color-hole.gif');
        $this->mapper->save($handle, IMG_PATH . 'temp/test.gd');
        $this->assertTrue(filesize(IMG_PATH . 'temp/test.gd') > 0);
        imagedestroy($handle);
        // file is a valid image
开发者ID:NablusTechMeetups,项目名称:web,代码行数:31,代码来源:GDTest.php

示例7: setup

    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
  **/
include WideImage::path() . 'Mapper/PNG.php';
/**
 * @package Tests
 */
class WideImage_Mapper_PNG_Test extends WideImage_TestCase
{
    protected $mapper;
    function setup()
    {
        $this->mapper = WideImage_MapperFactory::selectMapper(null, 'png');
    }
    function teardown()
    {
        $this->mapper = null;
        if (file_exists(IMG_PATH . 'temp/test.png')) {
            unlink(IMG_PATH . 'temp/test.png');
开发者ID:NaszvadiG,项目名称:DivaSul,代码行数:31,代码来源:PNGTest.php

示例8: load

    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 Internal/Mappers
  **/
include_once WideImage::path() . '/vendor/JPEXS/bmp.php';
/**
 * Mapper support for BMP
 * 
 * Code used with permission from JPEXS
 * http://www.jpexs.com/php.html
 * 
 * @package Internal/Mappers
 */
class WideImage_Mapper_BMP
{
    function load($uri)
    {
        return imagecreatefrombmp($uri);
    }
    function save($handle, $uri = null)
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:31,代码来源:BMP.php

示例9: setup

    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
  **/
include WideImage::path() . 'Mapper/BMP.php';
/**
 * @package Tests
 */
class WideImage_Mapper_BMP_Test extends WideImage_TestCase
{
    /**
     * @var WideImage_Mapper_BMP
     */
    protected $mapper;
    function setup()
    {
        $this->mapper = WideImage_MapperFactory::selectMapper(null, 'bmp');
    }
    function teardown()
    {
开发者ID:NaszvadiG,项目名称:DivaSul,代码行数:31,代码来源:BMPTest.php

示例10: setup

<?php

/**
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

     **/
include WideImage::path() . 'Mapper/TGA.php';
/**
 * @group mapper
 */
class WideImage_Mapper_TGA_Test extends WideImage_TestCase
{
    /**
     * @var WideImage_Mapper_TGA
     */
    protected $mapper;
    public function setup()
    {
        $this->mapper = WideImage_MapperFactory::selectMapper(null, 'tga');
    }
    public function teardown()
    {
        $this->mapper = null;
    }
    public function testLoad()
    {
        $handle = $this->mapper->load(IMG_PATH . 'splat.tga');
        $this->assertTrue(is_resource($handle));
        $this->assertEquals(100, imagesx($handle));
        $this->assertEquals(100, imagesy($handle));
        imagedestroy($handle);
开发者ID:NablusTechMeetups,项目名称:web,代码行数:31,代码来源:TGATest.php


注:本文中的WideImage::path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。