Changeset 4458
- Timestamp:
- 01/05/12 20:35:32 (5 months ago)
- Location:
- plugins/apostrophePlugin/branches/1.5/lib
- Files:
-
- 2 modified
-
action/BaseaSlideshowSlotComponents.class.php (modified) (2 diffs)
-
toolkit/aImageConverter.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/branches/1.5/lib/action/BaseaSlideshowSlotComponents.class.php
r4378 r4458 24 24 $this->setupOptions(); 25 25 $this->getLinkedItems(); 26 27 if ($this->options['uncropped']) 28 { 29 $newItems = array(); 30 foreach ($this->items as $item) 31 { 32 $item = $item->getCropOriginal(); 33 $newItems[] = $item; 34 } 35 $this->items = $newItems; 36 } 26 37 27 38 if ($this->options['random'] && count($this->items)) … … 66 77 $this->options['slideshowTemplate'] = $this->getOption('slideshowTemplate', 'slideshow'); 67 78 $this->options['random'] = $this->getOption('random', false); 79 // Ignore any manual crops by the user. This is useful if you want to use 'c' in an 80 // alternative rendering of a slideshow where custom crops are normally welcome 81 $this->options['uncropped'] = $this->getOption('uncropped', false); 68 82 69 83 // We automatically set up the aspect ratio if the resizeType is set to 'c' -
plugins/apostrophePlugin/branches/1.5/lib/toolkit/aImageConverter.class.php
r4341 r4458 100 100 static public function cropOriginal($fileIn, $fileOut, $width, $height, $quality = 75, $cropLeft = null, $cropTop = null, $cropWidth = null, $cropHeight = null) 101 101 { 102 $args = func_get_args(); 103 error_log(implode(',', $args)); 102 104 // Allow skipping of parameters 103 105 if (is_null($quality)) … … 108 110 $height = ceil($height); 109 111 $quality = ceil($quality); 110 list($iwidth, $iheight) = getimagesize($fileIn); 111 if (!$iwidth) 112 // Make sure we use a method that understands about JPEG orientation 113 $info = aImageConverter::getInfo($fileIn); 114 if (!$info) 112 115 { 113 116 return false; 114 117 } 118 $iwidth = $info['width']; 119 $iheight = $info['height']; 120 115 121 $iratio = $iwidth / $iheight; 116 122 $ratio = $width / $height; … … 146 152 $scale = array('xysize' => array($width + 0, $height + 0)); 147 153 $crop = array('left' => $cropLeft, 'top' => $cropTop, 'width' => $cropWidth, 'height' => $cropHeight); 154 error_log("scale: " . json_encode($scale)); 155 error_log("crop: " . json_encode($crop)); 148 156 return self::scaleBody($fileIn, $fileOut, $scale, $crop, $quality); 149 157 }

