[TYPO3-english] extenstion generate thumbnails

Morten Hagh morten at hagh.dk
Tue Nov 29 09:53:20 CET 2011


Hi list,

I have a giant problem with a small gallery. It's a small gallery with a
category view, album view and image view.

The page with the image view displays a large image and x number of
thumbnails and when I click on a thumbnail, that will display a large
version - but my problem is that the page with image view is being
generated VERY slowly.

I have tracked the problem down to the generation of the thumbnails and
realised that I have done something very not-good and I want to ask if
there is a better way.

My thumbnails are generated with this (inside the image view function
called "getAlbumContent":

$photos = explode(",", $row["photos"]);

foreach($photos as $key => $value) {

   $linkconf = array(
      'parameter' => $this->conf["detail."]["pid_detail"],
      'additionalParams' => '&tx_projgallery_pi1[cat]='.
$this->piVars["cat"].'&tx_projgallery_pi1[album]='.$row['parent_gallery'].'&tx_projgallery_pi1[show]='.$key,
      'ATagParams' => 'title="'. $this->pi_getLL('show_large') .'"',
      'useCacheHash' => true,
   );

   $imgConf = array();
   $imgConf['file'] = 'uploads/tx_projgallery/'. $value;
   $imgConf['file.']['width'] = $this->conf["thumb."]["width"] . $prefix;
   $imgConf['file.']['height'] = $this->conf["thumb."]["height"] . $prefix;
   $imgOutput = $this->cObj->IMG_RESOURCE($imgConf);

   $markers["###THUMBS###"] .= "<li>" . $this->cObj->typolink('<img
src="'. $imgOutput .'" width="'. $imgConf['file.']['width'] .'"
height="'. $imgConf['file.']['height'] .'" />', $linkconf) ."</li>";
}

But it look like that will run every time I click an image for a large
view and that takes a very long time.


/Morten Hagh


More information about the TYPO3-english mailing list