任意の形式と解像度の画像のデータベース

顧客:JPEGで50×50と100×100のユーザーアバターを用意しましょう

開発者:完了



顧客:アバターをPNGにするためにやり直す必要があります

開発者:Made



顧客:アバターをGIF、25×25および40×40に入れます

開発者:はい、チェック

顧客:もう? どうやってこんなに早くやってるの?

開発者:...



そのようなもの

  1. ダウンロードした画像はすべて元の形式で保存されるため、品質を最小限に抑えて変換できます。
  2. DOCUMENT ROOTでは、空のフォルダーが作成され、そこに.htaccessが配置されます。存在しないファイルにアクセスすると、proxy.phpの実行を渡します。
  3. 特定のテンプレートへのリクエストURLの対応に応じてproxy.php。たとえば、/ img / avatars / {id►_big.jpgは識別子{id}の画像を取得し、多くの変換を実行し、対応するリクエストでファイルに保存し、クライアントを同じURL。
  4. 同じURLで再リクエストすると、proxy.phpはもう呼び出されません。 必要な画像ファイルは既に存在します。
このようなスキームを実装するために、上記のすべてを美しく簡潔な方法で実装するPrimageライブラリがあります。



というか

このPrimageに基づいて、 proxy.phpのバージョンを実装します。



  1. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  2. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  3. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  4. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  5. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  6. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  7. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  8. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  9. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  10. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  11. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  12. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  13. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  14. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  15. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  16. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  17. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  18. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  19. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  20. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  21. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  22. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  23. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  24. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  25. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  26. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  27. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  28. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  29. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  30. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  31. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  32. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  33. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;



  34. // $avatarsStorage = new Primage_Proxy_Storage ( 'data/avatars' , 'jpg' , 90 ) ; // $avatarsProxyStorage = new Primage_Proxy_Storage ( 'public_html/img/avatars' , 'jpg' , 80 ) ; // URL $router = new Primage_Proxy_Router ( false ) ; // $avatarsBig = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsBig -> addAction ( new Primage_Proxy_Action_Resize ( 200 , 300 ) ) ; $router -> addController ( 'avatars/{id}_big.jpg' , $avatarsBig ) ; // $avatarsSmall = new Primage_Proxy_Controller_CopyById ( $avatarsStorage , $avatarsProxyStorage ) ; $avatarsSmall -> addAction ( new Primage_Proxy_Action_Resize ( 50 , 50 ) ) ; $router -> addController ( 'avatars/{id}_small.jpg' , $avatarsSmall ) ; // ( .. ) $step = 50 ; $maxWidth = 1000 ; $maxHeight = 1000 ; $avatarsDynamic = new Primage_Proxy_Controller_CopyWithResize ( $avatarsStorage , $avatarsProxyStorage , $maxWidth , $maxHeight , $step ) ; $router -> addController ( 'avatars/{id}_{width}x{height}.jpg' , $avatarsDynamic ) ; // $controller = $router -> getController ( $_SERVER [ 'REQUEST_URI' ] , & $params ) ; if ( $controller ) { try { $controller -> dispatch ( $params ) ; header ( 'Location: ' . $_SERVER [ 'REQUEST_URI' ] ) ; exit ; } catch ( Primage_Proxy_Storage_SourceNotFound $e ) { } catch ( Primage_Proxy_Controller_RequestException $e ) { } } header ( 'HTTP/1.0 404 Not Found' ) ;





これが私たちがするために必要なことのすべてであり、それからPrimageに任されます。Primageには、画像の保存と処理の編成に関して、いくつかのより便利な機能が含まれています。



Primage 最新バージョンをダウンロードしたり、RSSアップデートを購読したり、プロジェクトページで開発に参加したりできます



プログラマーの日におめでとうございます!!!

幸運を祈ります! :)



All Articles