PHPで画像サムネイルを作成する便利クラス
PHPで画像サムネイルを作成する便利クラス『PHP Thumbnailer』
オリジナル画像は下のオムライス。サイズは横500×縦375ピクセル。
![]()
html内で絶対パスで画像を指定します。縮小された表示ではなくて、ダイレクトにphpがサムネールを作成します。
![]()
最近のアップルのデザインに多用されているリフレクション効果も可能です。
createReflection($percent,$reflection,$white,$border,$borderColor)
- $percent - What percentage of the image to create the reflection from
- $reflection - What percentage of the image height should the reflection height be
- $white - How transparent (using white as the background) the reflection should be, as a percent
- $border - Whether a border should be drawn around the original image (default is true)
- $borderColor - The hex value of the color you would like your border to be (default is #a4a4a4)
その都度ダイレクトに画像を生成するのでサーバーに負荷がかかります。ECサイトなどの画像を多用するサイト向きではないかもしれません。
カテゴリ
Code
トラックバック(0)(クリック▼)
トラックバックURL

コメントを書く