Development

Changeset 33410

You must first sign up to be able to contribute.

Changeset 33410

Show
Ignore:
Timestamp:
04/17/12 16:21:38 (1 year ago)
Author:
nicolx
Message:

quality for transformed images and update for documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrineActAsSluggableAttachmentPlugin

    • Property svn:ignore set to
      nbproject
  • plugins/sfDoctrineActAsSluggableAttachmentPlugin/trunk/README

    r31958 r33410  
    4848            models: 
    4949              product: 
    50                 original: { size: 1024x768, thumbnailing: scale, force: false
    51                 thumb: { size: 100x100, thumbnailing: center, force: true
    52                 mini: { size: 25x25, thumbnailing: fit, force: true
     50                original: { size: 1024x768, thumbnailing: scale, force: false, quality: 95
     51                thumb: { size: 100x100, thumbnailing: center, force: true, quality: 90
     52                mini: { size: 25x25, thumbnailing: fit, force: true, quality: 75
    5353 
    54      * size - The width/height of the thumbnail 
    55      * thumbnailing - See sfImageTransformPlugin (sfImage->thumbnail) for documentation 
     54     * size - The width/height of the thumbnail. 
     55     * thumbnailing - See sfImageTransformPlugin (sfImage->thumbnail) for documentation. 
    5656     * force - When set to false, the image will not be resize if the original size is smaller than the specified size. 
     57     * quality - Quality of image transformed. 
    5758 
    5859 * Edit the lib/form/ProductForm.class.php 
     
    6667            $this->useFields(array(..., "attachment_filename")); 
    6768            $this->widgetSchema['attachment_filename'] = new sfWidgetFormInputFile(); 
    68             $this->validatorSchema['attachment_filename'] = 
    69               new sfValidatorDoctrineSluggableAttachment($this->getObject()); 
     69            $this->validatorSchema['attachment_filename'] = new sfValidatorDoctrineSluggableAttachment($this->getObject()); 
    7070          } 
    7171        } 
     
    100100            $this->useFields(array(..., "attachment_filename")); 
    101101            $this->widgetSchema['attachment_filename'] = new sfWidgetFormInputFile(); 
    102             $this->validatorSchema['attachment_filename'] = 
    103               new sfValidatorDoctrineSluggableAttachment($this->getObject()); 
     102            $this->validatorSchema['attachment_filename'] = new sfValidatorDoctrineSluggableAttachment($this->getObject()); 
    104103          } 
    105104        } 
  • plugins/sfDoctrineActAsSluggableAttachmentPlugin/trunk/config/app.yml

    r31957 r33410  
    99  actAsDoctrineSluggableAttachment: 
    1010#      model_name: 
    11 #        thumb: { size: 100x100, thumbnailing: center
     11#        thumb: { size: 100x100, thumbnailing: center, quality: 90
  • plugins/sfDoctrineActAsSluggableAttachmentPlugin/trunk/lib/template/SluggableAttachment.class.php

    r33356 r33410  
    165165    foreach($this->getAttachmentStyles() as $styleNane => $style) 
    166166    { 
     167      $quality = isset($style["quality"]) ? $style["quality"] : 90; 
    167168      $img = new sfImage($input_image); 
    168169      $directory = dirname($path).DIRECTORY_SEPARATOR.$styleNane; 
     
    176177        } 
    177178      } 
     179      $img->setQuality($quality); 
    178180      $img->saveAs($directory.DIRECTORY_SEPARATOR.$this->getFullFilename()); 
    179181    }