From 9ea38c17cf727be17cba61e5b198f52ecba7f36c Mon Sep 17 00:00:00 2001 From: Jeff Segars Date: Thu, 31 Jan 2008 17:04:49 +0000 Subject: [PATCH] Fixed bug #6902: Add an imagespace to Text w/ Image when image width is not available. Thanks to Georg Ringer. git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2988 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ .../pi1/class.tx_cssstyledcontent_pi1.php | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f0c3df30f1..4e2bcb615c6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-31 Jeff Segars + + * Fixed bug #6902: Add an imagespace to Text w/ Image when image width is not available. Thanks to Georg Ringer. + 2008-01-31 Benjamin Mack * Fixed Bug #4770: css_styled_content - rowSpace also puts space below last image row diff --git a/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php b/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php index 74e8e236298..e37d163786b 100755 --- a/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php +++ b/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php @@ -644,7 +644,12 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase { // Store the original filepath $origImages[$imgKey] = $GLOBALS['TSFE']->lastImageInfo; - $imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0]; + if ($GLOBALS['TSFE']->lastImageInfo[0]==0) { + $imageRowsFinalWidths[floor($a/$colCount)] += $this->cObj->data['imagewidth']; + } else { + $imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0]; + } + } // How much space will the image-block occupy? $imageBlockWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*($borderSpace+$borderThickness)*2; @@ -707,7 +712,12 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase { } // Render one image - $imageSpace = $origImages[$imgKey][0] + $border*($borderSpace+$borderThickness)*2; + if($origImages[$imgKey][0]==0) { + $imageSpace=$this->cObj->data['imagewidth'] + $border*($borderSpace+$borderThickness)*2; + } else { + $imageSpace = $origImages[$imgKey][0] + $border*($borderSpace+$borderThickness)*2; + } + $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgKey; $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgKey; $GLOBALS['TSFE']->register['ORIG_FILENAME'] = $origImages[$imgKey]['origFile']; -- 2.20.1