Development

Changeset 28653 for plugins/sfImageTransformExtraPlugin/trunk/config

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
03/21/10 22:09:11 (3 years ago)
Author:
caefer
Message:

several changes towards stable release

  • corrected routing
  • format examples are renamed
  • thumbnailing.yml is cleaned up
  • sfImageTransformExtraPluginConfiguration is cleaned up
  • TODO is updated
  • README is updated
  • sfImageSource classes are made more similar
  • New! sfImageSourcePropel to work with image sources linked by Propel objects
  • resources are cleaned up
  • free font is used (was unclear before)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfImageTransformExtraPlugin/trunk/config/routing.yml

    r28643 r28653  
    44  param: { module: sfImageTransformator, action: index, attribute: file } 
    55  requirements: 
    6     format:    '[\w_-]+(?:,[\w_-]+(?:,[\w_-]+)?)?
     6    format:    '[\w_-]+
    77    path:      '[\w/]+' 
    88    slug:      '[\w_-]+' 
     
    2020  requirements: 
    2121    format:    '[\w_-]+' 
    22     filepath:  '[\w/]+' 
     22    filepath:  '[\w/.]+' 
    2323    sf_format: 'gif|png|jpg' 
    2424    sf_method: [ get ] 
     
    2828sf_image_http: 
    2929  class: sfImageTransformRoute 
    30   url:   /thumbnails/:format/:protocol/:domain/:filepath.:sf_format 
    31   param: { module: sfImageTransformator, action: index
     30  url:   /thumbnails/site/:format/:filepath.:sf_format 
     31  param: { module: sfImageTransformator, action: index, protocol: http, domain: localhost
    3232  requirements: 
    3333    format:    '[\w_-]+' 
    34     sf_format: http|https 
     34    protocol:  'http|https' 
    3535    domain:    '[\w-_.]+' 
    36     filepath:  '[\w/-_.]+' 
     36    filepath:  '[\w-_/.]+' 
    3737    sf_format: 'gif|png|jpg' 
    3838    sf_method: [ get ] 
  • plugins/sfImageTransformExtraPlugin/trunk/config/sfImageTransformExtraPluginConfiguration.class.php

    r28619 r28653  
    3434    } 
    3535 
    36     //$this->dispatcher->connect('context.load_factories', array('sfImageTransformExtraPluginConfiguration', 'registerStreamWrapper')); 
    3736    $this->dispatcher->connect('controller.change_action', array('sfImageTransformExtraPluginConfiguration', 'setViewCache')); 
    3837    $this->dispatcher->connect('sf_image_transform.changed_source', array('sfImageTransformExtraPluginConfiguration', 'removeOldThumbnails')); 
     
    9392 
    9493  /** 
    95    * Registers the sfImageSource:// protocol stream wrapper 
    96    * 
    97    * @static 
    98    * @param  sfEvent $event Event object as passed by symfony event system 
    99    * 
    100    * @return void 
    101    */ 
    102   static public function registerStreamWrapper(sfEvent $event) 
    103   { 
    104     if(in_array('sfImageSource', stream_get_wrappers())) 
    105     { 
    106       stream_wrapper_unregister('sfImageSource'); 
    107     } 
    108     $streamwrapper = sfConfig::get('thumbnailing_source_image_stream_class', 'sfImageSourceMock'); 
    109     stream_wrapper_register('sfImageSource', $streamwrapper) or die('Failed to register protocol..'); 
    110   } 
    111  
    112   /** 
    11394   * Removes all generated thumbnails for given asset when a new contentAsset is published 
    11495   * 
  • plugins/sfImageTransformExtraPlugin/trunk/config/thumbnailing.yml

    r28619 r28653  
    1 prod: 
    2  
    31all: 
    4   static_image_host:                ~ 
    5   web_dir:                          /thumbnails 
    6   id_path_depth:                    3 
    7  
    82  .settings: 
    93    formats: 
     
    2317        mime_type:                  image/jpg 
    2418        transformations:            [] 
    25 # ------------------------------------------------------------------------------- 
    26       demo_alpha_mask_frame: 
    27         quality:                75 
    28         mime_type:              image/png 
    29         transformations: 
    30           - { adapter: GD, transformation: resize,    param: { width: 300, height: 200, inflate: on, proportional: on }} 
    31           - { adapter: GD, transformation: alphaMask, param: { mask: masks/frame.gif }} 
    32       demo_alpha_mask_pattern: 
    33         quality:                75 
    34         mime_type:              image/png 
    35         transformations: 
    36           - { adapter: GD, transformation: resize,    param: { width: 250, height: 200, inflate: on, proportional: on }} 
    37           - { adapter: GD, transformation: alphaMask, param: { mask: masks/pattern.gif }} 
    38       demo_rounded_corners: 
    39         quality:                75 
    40         mime_type:              image/gif 
    41         transformations: 
    42           - { adapter: GD, transformation: resize,         param: { width: 300, height: 200, inflate: on, proportional: on }} 
    43           - { adapter: GD, transformation: roundedCorners, param: { radius: 80 }} 
    44       demo_thumbnail_fit: 
    45         quality:                75 
    46         mime_type:              image/jpg 
    47         transformations: 
    48           - { adapter: GD, transformation: thumbnail, param: { width: 100, height: 100, method: fit, background: '#FF0000' }} 
    49       demo_thumbnail_scale: 
    50         quality:                75 
    51         mime_type:              image/jpg 
    52         transformations: 
    53           - { adapter: GD, transformation: thumbnail, param: { width: 100, height: 100, method: scale, background: '#FF0000' }} 
    54       demo_thumbnail_deflate: 
    55         quality:                75 
    56         mime_type:              image/jpg 
    57         transformations: 
    58           - { adapter: GD, transformation: thumbnail, param: { width: 100, height: 100, method: deflate, background: '#FF0000' }} 
    59       demo_resize: 
    60         quality:                75 
    61         mime_type:              image/jpg 
    62         transformations: 
    63           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    64       demo_border: 
    65         quality:                75 
    66         mime_type:              image/jpg 
    67         transformations: 
    68           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    69           - { adapter: GD, transformation: border, param: { thickness: 4, color: '#0000FF' }} 
    70       demo_arc: 
    71         quality:                75 
    72         mime_type:              image/jpg 
    73         transformations: 
    74           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    75           - { adapter: GD, transformation: arc,    param: { x: 100, y: 100, width: 50, height: 30, start_angle: 0, end_angle: 270, thickness: 2, color: '#00FF00', fill: '#FFFF00', style: off }} 
    76       demo_brightness: 
    77         quality:                75 
    78         mime_type:              image/jpg 
    79         transformations: 
    80           - { adapter: GD, transformation: resize,     param: { width: 250, height: 200, inflate: on, proportional: on }} 
    81           - { adapter: GD, transformation: brightness, param: { brightness: 50 }} 
    82       demo_colorize: 
    83         quality:                75 
    84         mime_type:              image/jpg 
    85         transformations: 
    86           - { adapter: GD, transformation: resize,   param: { width: 250, height: 200, inflate: on, proportional: on }} 
    87           - { adapter: GD, transformation: colorize, param: { red: 255, green: 0, blue: 0, alpha: 50 }} 
    88       demo_contrast_max: 
    89         quality:                75 
    90         mime_type:              image/jpg 
    91         transformations: 
    92           - { adapter: GD, transformation: resize,   param: { width: 250, height: 200, inflate: on, proportional: on }} 
    93           - { adapter: GD, transformation: contrast, param: { contrast: -80 }} 
    94       demo_contrast_min: 
    95         quality:                75 
    96         mime_type:              image/jpg 
    97         transformations: 
    98           - { adapter: GD, transformation: resize,   param: { width: 250, height: 200, inflate: on, proportional: on }} 
    99           - { adapter: GD, transformation: contrast, param: { contrast: 50 }} 
    100       demo_crop: 
    101         quality:                75 
    102         mime_type:              image/jpg 
    103         transformations: 
    104           - { adapter: GD,      transformation: crop, param: { left: 50, top: 400, width: 250, height: 200 }} 
    105       demo_edgeDetect: 
    106         quality:                75 
    107         mime_type:              image/jpg 
    108         transformations: 
    109           - { adapter: GD, transformation: resize,     param: { width: 250, height: 200, inflate: on, proportional: on }} 
    110           - { adapter: GD, transformation: edgeDetect, param: {}} 
    111       demo_ellipse: 
    112         quality:                75 
    113         mime_type:              image/jpg 
    114         transformations: 
    115           - { adapter: GD, transformation: resize,  param: { width: 250, height: 200, inflate: on, proportional: on }} 
    116           - { adapter: GD, transformation: ellipse, param: { x: 120, y: 120, width: 100, height: 40, thickness: 3, color: '#00FF00', fill: off, style: off }} 
    117       demo_emboss: 
    118         quality:                75 
    119         mime_type:              image/jpg 
    120         transformations: 
    121           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    122           - { adapter: GD, transformation: emboss, param: {}} 
    123       demo_fill: 
    124         quality:                75 
    125         mime_type:              image/jpg 
    126         transformations: 
    127           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    128           - { adapter: GD, transformation: fill,   param: { x: 20, y: 20, fill: '#00FFFF' }} 
    129       demo_flip: 
    130         quality:                75 
    131         mime_type:              image/jpg 
    132         transformations: 
    133           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    134           - { adapter: GD, transformation: flip,   param: {}} 
    135       demo_gamma: 
    136         quality:                75 
    137         mime_type:              image/jpg 
    138         transformations: 
    139           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    140           - { adapter: GD, transformation: gamma,  param: { input_gamma: 1.0, output_gamma: 1.6 }} 
    141       demo_gaussianBlur: 
    142         quality:                75 
    143         mime_type:              image/jpg 
    144         transformations: 
    145           - { adapter: GD, transformation: resize,       param: { width: 250, height: 200, inflate: on, proportional: on }} 
    146           - { adapter: GD, transformation: gaussianBlur, param: {}} 
    147       demo_greyscale: 
    148         quality:                75 
    149         mime_type:              image/jpg 
    150         transformations: 
    151           - { adapter: GD, transformation: resize,    param: { width: 250, height: 200, inflate: on, proportional: on }} 
    152           - { adapter: GD, transformation: greyscale, param: {}} 
    153       demo_line: 
    154         quality:                75 
    155         mime_type:              image/jpg 
    156         transformations: 
    157           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    158           - { adapter: GD, transformation: line,   param: { x1: 20, y1: 30, x2: 180, y2: 120, thickness: 8, color: '#FF0000', style: off }} 
    159       demo_mirror: 
    160         quality:                75 
    161         mime_type:              image/jpg 
    162         transformations: 
    163           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    164           - { adapter: GD, transformation: mirror, param: {}} 
    165       demo_negate: 
    166         quality:                75 
    167         mime_type:              image/jpg 
    168         transformations: 
    169           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    170           - { adapter: GD, transformation: negate, param: {}} 
    171       demo_noise: 
    172         quality:                75 
    173         mime_type:              image/jpg 
    174         transformations: 
    175           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    176           - { adapter: GD, transformation: noise,  param: { density: 40 }} 
    177       demo_opacity: 
    178         quality:                75 
    179         mime_type:              image/png 
    180         transformations: 
    181           - { adapter: GD, transformation: resize,  param: { width: 250, height: 200, inflate: on, proportional: on }} 
    182           - { adapter: GD, transformation: opacity, param: { opacity: 25 }} 
    183       demo_overlay: 
    184         quality:                75 
    185         mime_type:              image/jpg 
    186         transformations: 
    187           - { adapter: GD, transformation: resize,  param: { width: 250, height: 200, inflate: on, proportional: on }} 
    188           - { adapter: GD, transformation: overlay, param: { overlay: overlays/wlcp.png, position: top-right }} 
    189       demo_pixelBlur: 
    190         quality:                75 
    191         mime_type:              image/jpg 
    192         transformations: 
    193           - { adapter: GD, transformation: resize,    param: { width: 250, height: 200, inflate: on, proportional: on }} 
    194           - { adapter: GD, transformation: pixelBlur, param: { blur: 3 }} 
    195       demo_pixelize: 
    196         quality:                75 
    197         mime_type:              image/jpg 
    198         transformations: 
    199           - { adapter: GD, transformation: resize,   param: { width: 250, height: 200, inflate: on, proportional: on }} 
    200           - { adapter: GD, transformation: pixelize, param: { size: 10 }} 
    201       demo_rectangle: 
    202         quality:                75 
    203         mime_type:              image/jpg 
    204         transformations: 
    205           - { adapter: GD, transformation: resize,    param: { width: 250, height: 200, inflate: on, proportional: on }} 
    206           - { adapter: GD, transformation: rectangle, param: { x1: 20, y1: 30, x2: 130, y2: 180, thickness: 8, color: '#FF00FF', fill: off, style: off }} 
    207       demo_reflection: 
    208         quality:                75 
    209         mime_type:              image/jpg 
    210         transformations: 
    211           - { adapter: GD, transformation: resize,     param: { width: 250, height: 200, inflate: on, proportional: on }} 
    212           - { adapter: GD, transformation: reflection, param: { reflection_height: 80, start_transparency: 20 }} 
    213       demo_resizeSimple: 
    214         quality:                75 
    215         mime_type:              image/jpg 
    216         transformations: 
    217           - { adapter: GD, transformation: resizeSimple, param: { width: 250, height: 200 }} 
    218       demo_rotate: 
    219         quality:                75 
    220         mime_type:              image/jpg 
    221         transformations: 
    222           - { adapter: GD, transformation: resize, param: { width: 700, height: 600, inflate: on, proportional: on }} 
    223           - { adapter: GD, transformation: rotate, param: { angle: 50, background: '#00FF00' }} 
    224           - { adapter: GD, transformation: crop,   param: { left: 300, top: 300, width: 250, height: 200 }} 
    225       demo_scale: 
    226         quality:                75 
    227         mime_type:              image/jpg 
    228         transformations: 
    229           - { adapter: GD, transformation: scale, param: { scale: 0.2 }} 
    230       demo_scatter: 
    231         quality:                75 
    232         mime_type:              image/jpg 
    233         transformations: 
    234           - { adapter: GD, transformation: resize,  param: { width: 250, height: 200, inflate: on, proportional: on }} 
    235           - { adapter: GD, transformation: scatter, param: { scatter: 4 }} 
    236       demo_selectiveBlur: 
    237         quality:                75 
    238         mime_type:              image/jpg 
    239         transformations: 
    240           - { adapter: GD, transformation: resize,        param: { width: 250, height: 200, inflate: on, proportional: on }} 
    241           - { adapter: GD, transformation: selectiveBlur, param: {}} 
    242       demo_sketchy: 
    243         quality:                75 
    244         mime_type:              image/jpg 
    245         transformations: 
    246           - { adapter: GD, transformation: resize,  param: { width: 250, height: 200, inflate: on, proportional: on }} 
    247           - { adapter: GD, transformation: sketchy, param: {}} 
    248       demo_smooth: 
    249         quality:                75 
    250         mime_type:              image/jpg 
    251         transformations: 
    252           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    253           - { adapter: GD, transformation: smooth, param: { smoothness: 2 }} 
    254       demo_text: 
    255         quality:                75 
    256         mime_type:              image/jpg 
    257         transformations: 
    258           - { adapter: GD, transformation: resize, param: { width: 250, height: 200, inflate: on, proportional: on }} 
    259           - { adapter: GD, transformation: text,   param: { text: 'Hello World!', x: 10, y: 140, size: 24, font: accid___, color: '#FFFFFF', angle: 0 }} 
    260       demo_transparency: 
    261         quality:                75 
    262         mime_type:              image/gif 
    263         transformations: 
    264           - { adapter: GD, transformation: resize,       param: { width: 250, height: 200, inflate: on, proportional: on }} 
    265           - { adapter: GD, transformation: transparency, param: { color: '#000000' }}