2010-11-13 Benjamin Mack <benni@typo3.org>
+ * Added feature: New option "noScale" for getImgResource() to display the original image instead of a scaled one (Thanks to Stefan Geith)
* Fixed bug #7855: IRRE doesn't save collapse/expand state of nested IRRE records
* Fixed bug #9508: Workspace preview link should work in multidomain-environments (Thanks to Michael Klapper)
* Added feature #13170: Workspace Owners should be manageable with groups as well (Thanks to Tolleiv Nietsch)
$w=$data['origW'];
$h=$data['origH'];
- // if no convertion should be performed
- $wh_noscale = (!$w && !$h) || ($data[0]==$info[0] && $data[1]==$info[1]); // this flag is true if the width / height does NOT dictate the image to be scaled!! (that is if no w/h is given or if the destination w/h matches the original image-dimensions....
-
- if ($wh_noscale && !$data['crs'] && !$params && !$frame && $newExt==$info[2] && !$mustCreate) {
+ // if no conversion should be performed
+ // this flag is true if the width / height does NOT dictate
+ // the image to be scaled!! (that is if no width / height is
+ // given or if the destination w/h matches the original image
+ // dimensions or if the option to not scale the image is set)
+ $noScale = (!$w && !$h) || ($data[0] == $info[0] && $data[1] == $info[1]) || $options['noScale'];
+
+ if ($noScale && !$data['crs'] && !$params && !$frame && $newExt == $info[2] && !$mustCreate) {
+ // set the new width and height before returning,
+ // if the noScale option is set
+ if ($options['noScale']) {
+ $info[0] = $data[0];
+ $info[1] = $data[1];
+ }
$info[3] = $imagefile;
return $info;
}
$fileArray['maxH'] = intval($this->stdWrap($fileArray['maxH'], $fileArray['maxH.']));
$fileArray['minW'] = intval($this->stdWrap($fileArray['minW'], $fileArray['minW.']));
$fileArray['minH'] = intval($this->stdWrap($fileArray['minH'], $fileArray['minH.']));
+ $fileArray['noScale'] = $this->stdWrap($fileArray['noScale'], $fileArray['noScale.']);
$maskArray = $fileArray['m.'];
$maskImages = array();
if (is_array($fileArray['m.'])) { // Must render mask images and include in hash-calculating - else we cannot be sure the filename is unique for the setup!
if ($fileArray['minH']) {
$options['minH'] = $fileArray['minH'];
}
+ if ($fileArray['noScale']) {
+ $options['noScale'] = $fileArray['noScale'];
+ }
// checks to see if m (the mask array) is defined
if (is_array($maskArray) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {