BEAR_Img
[ class tree: BEAR_Img ] [ index: BEAR_Img ] [ all elements ]

Class: BEAR_Img_Adapter_Magick

Source Location: /BEAR/Img/Adapter/Magick.php

Class Overview

BEAR_Base
   |
   --BEAR_Img_Adapter
      |
      --BEAR_Img_Adapter_Magick

iMagickクラス


Author(s):

Version:

  • SVN: Release: @package_version@ $Id: Magick.php 2486 2011-06-06 07:44:05Z koriyama@bear-project.net $

Copyright:

  • 2008-2011 Akihito Koriyama All rights reserved.

Variables

Methods


Inherited Variables

Inherited Methods

Class: BEAR_Img_Adapter

BEAR_Img_Adapter::__construct()
Constructor.
BEAR_Img_Adapter::deleteFile()
ファイルの消去
BEAR_Img_Adapter::getExtention()
image typeから拡張子を求める
BEAR_Img_Adapter::getImageInfo()
画像情報の取得
BEAR_Img_Adapter::getTmpFileName()
一時ファイル名を取得
BEAR_Img_Adapter::header()
ヘッダー出力
BEAR_Img_Adapter::loadRemoteFile()
ファイルの読み込み
BEAR_Img_Adapter::onInject()
Inject
BEAR_Img_Adapter::resizeMobile()
モバイル端末に合わせた画像の最大リサイズ
BEAR_Img_Adapter::_error()
エラー終了

Class: BEAR_Base

BEAR_Base::__construct()
Universal constructor
BEAR_Base::getConfig()
Get config
BEAR_Base::onInject()
Inject
BEAR_Base::setConfig()
Set config
BEAR_Base::setService()
Set service
BEAR_Base::_exception()
例外の作成

Class Details

[line 55]
iMagickクラス

iMagickクラス

 Image MagicおよびGraphich MagickをサポートしたPECLのiMagickをサポートするクラスです
Example. 画像のリサイズ表示</pre>
  1.   $img BEAR_Img::getInstance(BEAR_Img::ADAPTER_MAGICK);
  2.   $img->load('http://www.bear-project.net/images/eye.jpg');
  3.   $img->resize(320,240);
  4.   $img->show('jpeg');
 Example. iMagickオブジェクトを直接操作
  1.   $img BEAR_Img::getInstance(BEAR_Img::ADAPTER_MAGICK);
  2.   $img->load('http://www.bear-project.net/images/eye.jpg');
  3.   $img->resize(320,240);
  4.   // 木炭画エフェクト
  5.   $img->adapter->charcoalImage(11);
  6.   $img->save(_BEAR_APP_HOME '/tmp/picure.jpeg');




Tags:

author:  Akihito Koriyama <koriyama@bear-project.net>
version:  SVN: Release: @package_version@ $Id: Magick.php 2486 2011-06-06 07:44:05Z koriyama@bear-project.net $
copyright:  2008-2011 Akihito Koriyama All rights reserved.
link:  http://www.bear-project.net/
license:  BSD


[ Top ]


Class Variables

$_animGifFile =  ''

[line 70]

アニメGIFファイル名

アニメGIFファイル名




Tags:

access:  protected

Type:   bool


[ Top ]

$_isAnimGif =  false

[line 63]

アニメGIFではない

アニメGIFではない




Tags:

access:  protected

Type:   bool


[ Top ]



Class Methods


constructor __construct [line 83]

BEAR_Img_Adapter_Magick __construct( $config)

Constructor

Constructor




Tags:

throws:  BEAR_Img_Adapter_Magick_Exception
access:  public


Overrides BEAR_Img_Adapter::__construct() (Constructor.)

Parameters:

array   $config  

[ Top ]

method header [line 152]

void header( )

ヘッダーを出力

ヘッダーを出力

 イメージリソースの内容をみてHTTPヘッダーを出力します。
 他の画像タイプと違い画像タイプを出力する必要がありません
 imagick_getmimetypeを使用




Tags:

access:  public


Overrides BEAR_Img_Adapter::header() (ヘッダー出力)

[ Top ]

method load [line 104]

void load( string $file)

ファイルのロード

ファイルのロード

$fileにはローカルファイルのパスまたはリモートファイルのURLを指定します。
 リモートファイルの読み込みにはphp.iniでallow_url_fopen =Onの設定が必要です。




Tags:

throws:  BEAR_Img_Adapter_Magick_Exception
access:  public


Parameters:

string   $file  

[ Top ]

method resize [line 191]

void resize( [int $width = 240], [int $height = 240], [int $filter = Imagick::FILTER_LANCZOS], [int $blur = 1], [bool $fit = true])

画像のリサイズ

画像のリサイズ

 画像をリサイズします。アニメーションGIFもリサイズできます。
 リサイズ時に$filterを指定することもできます。
 $filterはIMAGICK_FILTER_*形式で指定します。




Tags:



Parameters:

int   $width  
int   $height  
int   $filter  
int   $blur  
bool   $fit  

[ Top ]

method save [line 263]

void save( string $filePath, [string $format = false])

画像保存

画像保存 指定のパスに画像を保存します。




Tags:

access:  public


Parameters:

string   $filePath   保存画像のファイルパス
string   $format   フォーマット

[ Top ]

method show [line 239]

void show( string $format)

画像を指定のフォーマットで表示

画像を指定のフォーマットで表示 画像を表示します。




Tags:

access:  public


Parameters:

string   $format   画像フォーマット

[ Top ]

method _resizeAnim [line 215]

void _resizeAnim( [int $width = 240])

アニメーションGIFのリサイズ

アニメーションGIFのリサイズ

 アニメーションGIFをリサイズします。magic関数には用意されていない機能なので
 シェルでconvertコマンドを実行しています




Tags:

access:  protected


Parameters:

int   $width   画像の幅

[ Top ]


Documentation generated on Sat, 30 Jul 2011 00:10:42 +0900 by phpDocumentor 1.4.3