/**
  * generates a copy of a give image with a specific width
  *
  * @param string $src path of the image to convert
  * @param integer $width width to convert the image to
  * @param string $format format of the resulting copy
  * @param string $quality quality of the resulting copy
  * @param string $treatIdAsReference given src argument is a sys_file_reference record
  * @param array $params additional params for the image rendering
  * @return string
  */
 public function getImgResource($src, $width, $format, $quality, $treatIdAsReference, $params = NULL)
 {
     $setup = array('width' => $width, 'treatIdAsReference' => $treatIdAsReference);
     if (FALSE === empty($format)) {
         $setup['ext'] = $format;
     }
     if (0 < intval($quality)) {
         $quality = MathUtility::forceIntegerInRange($quality, 10, 100, 75);
         $setup['params'] .= ' -quality ' . $quality;
     }
     if ('BE' === TYPO3_MODE && '../' === substr($src, 0, 3)) {
         $src = substr($src, 3);
     }
     return $this->contentObject->getImgResource($src, $setup);
 }
 /**
  * Method to raise a version number
  *
  * @param string $raise one of "main", "sub", "dev" - the version part to raise by one
  * @param string $version (like 4.1.20)
  * @return string
  * @throws \TYPO3\CMS\Core\Exception
  */
 public static function raiseVersionNumber($raise, $version)
 {
     if (!in_array($raise, array('main', 'sub', 'dev'))) {
         throw new \TYPO3\CMS\Core\Exception('RaiseVersionNumber expects one of "main", "sub" or "dev".', 1342639555);
     }
     $parts = GeneralUtility::intExplode('.', $version . '..');
     $parts[0] = MathUtility::forceIntegerInRange($parts[0], 0, 999);
     $parts[1] = MathUtility::forceIntegerInRange($parts[1], 0, 999);
     $parts[2] = MathUtility::forceIntegerInRange($parts[2], 0, 999);
     switch ((string) $raise) {
         case 'main':
             $parts[0]++;
             $parts[1] = 0;
             $parts[2] = 0;
             break;
         case 'sub':
             $parts[1]++;
             $parts[2] = 0;
             break;
         case 'dev':
             $parts[2]++;
             break;
     }
     return $parts[0] . '.' . $parts[1] . '.' . $parts[2];
 }