library/Garp/Image/Scaler.php
public function scaleAndStore($filename, $id, $template = null, $overwrite = false) {
        $templates = !is_null($template) ?
            (array)$template :
            //  template is left empty; scale source file along all configured templates
            $templates = $this->getTemplateNames();

        $file       = new Garp_Image_File(Garp_File::FILE_VARIANT_UPLOAD);
        $sourceData = $file->fetch($filename);
        $imageType  = $file->getImageType($filename);

        foreach ($templates as $template) {
            $this->_scaleAndStoreForTemplate($sourceData, $imageType, $id, $template, $overwrite);
        }
    }
public function scaleAndStore($filename, $id, $template = null, $overwrite = false) {
        $templates = !is_null($template) ?
            (array)$template :
            //  template is left empty; scale source file along all configured templates
            $templates = $this->getTemplateNames();

        $file       = new Garp_Image_File(Garp_File::FILE_VARIANT_UPLOAD);
        $sourceData = $file->fetch($filename);
        $imageType  = $file->getImageType($filename);

        foreach ($templates as $template) {
            $this->_scaleAndStoreForTemplate($sourceData, $imageType, $id, $template, $overwrite);
        }
    }
public function scaleAndStore ( $ filename , $ id , $ template = null , $ overwrite = false ) { $ templates = ! is_null ( $ template ) ? ( array ) $ template : //  template is left empty; scale source file along all configured templates $ templates = $ this -> getTemplateNames ( ) ; $ file = new Garp_Image_File ( Garp_File :: FILE_VARIANT_UPLOAD ) ; $ sourceData = $ file -> fetch ( $ filename ) ; $ imageType = $ file -> getImageType ( $ filename ) ; foreach ( $ templates as $ template ) { $ this -> _scaleAndStoreForTemplate ( $ sourceData , $ imageType , $ id , $ template , $ overwrite ) ; } }
Scales an image according to an image template, and stores it.

@param string $filename Filename of the source image
@param int    $id       Id of the database record corresponding to this image file
@param string $template Name of the template, if left empty,
scaled versions for all templates will be generated.
@param bool   $overwrite
@return void
Scales an image according to an image template and stores it .