[TYPO3-core] Improved t3lib_stdgraphic.php->>combineExec

Martin Kutschker Martin.Kutschker at blackbox.net
Tue Jul 5 10:27:49 CEST 2005


This is a CVS patch request.

Type: New feature

Description:
A new optional parameter that let's you position a smaller image with a IM geometry option.

Branches: HEAD

Bugtracker reference: http://bugs.typo3.org/view.php?id=1139

Files:
class.t3lib_stdgraphic.php-t3_380b1-geometry.patch 

Masi 
-------------- next part --------------
--- class.t3lib_stdgraphic.php.orig	2005-04-07 13:38:53.000000000 +0200
+++ class.t3lib_stdgraphic.php	2005-04-07 15:44:03.552021800 +0200
@@ -2392,11 +2421,15 @@
 	 * @param	string		The relative (to PATH_site) image filepath, overlay file (top)
 	 * @param	string		The relative (to PATH_site) image filepath, the mask file (grayscale)
 	 * @param	string		The relative (to PATH_site) image filepath, output filename (written to)
+	 * @param	string		An optional IM geometry parameter, eg +100+150
 	 * @return	void
 	 */
-	function combineExec($input,$overlay,$mask,$output)	{
+	function combineExec($input,$overlay,$mask,$output,$geometry='')	{
 		if (!$this->NO_IMAGE_MAGICK)	{
-			$cmd = $this->imageMagickPath.$this->combineScript.' -compose over '.$this->wrapFileName($input).' '.$this->wrapFileName($overlay).' '.$this->wrapFileName($mask).' '.$this->wrapFileName($output);
+			if ($geometry)	{
+				$geometry = '-geometry '.$geometry;
+			}
+			$cmd = $this->imageMagickPath.$this->combineScript.' -compose over '.$geometry.' -quality '.intval($gfxConf['im_jpg_quality']).' '.$this->wrapFileName($input).' '.$this->wrapFileName($overlay).' '.$this->wrapFileName($mask).' '.$this->wrapFileName($output);
 			$this->IM_commands[] = Array ($output,$cmd);
 
 			$ret = exec($cmd);


More information about the TYPO3-team-core mailing list