Zum Inhalt springen

Bilder verkleinern für Popup

Erstellt am 19. Dezember 2006 · 2 Antworten · letzte Antwort am 22. Dezember 2006

Tags: Bilder, Frage

BlackPixel ·

Hallo Community,

normalerweise ist es ja so, das wenn ich ein Bild hochlade, das dieses ja automatisch im Popup verkleinert wird.

Ich habe nun in einer eigenen Extension das Feld Bild eingebunden, und in der Darstellung des Datensatzes wird es perfekt verkleinert. Nur eben Beim drafklicken bekomme ich eine Version mit den maximalen Ausmaßen angezeigt. Hier mal der Code:

$file = 'uploads/tx_phpkamera/'.$this->getFieldContent('bild');
			$img["file"] = $file;
			$img['params'] = $this->pi_classParam('bild');
			$img['altText'] = $row['model'];
			$img['titleText'] = $row['model'];
			$img['imageLinkWrap'] = 1;
			$img['file.']['maxW']= 100;
			$img['file.']['maxH']= 100;
			$ImgCode = $this->cObj->IMAGE($img);
								   
			$conf['bodyTag'] = '<body bgColor=white leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
			$conf['JSwindow'] = '1';
			$conf['JSwindow.newWindow'] = '0';
			$conf['JSwindow.expand'] = '0,0';
			$conf['enable'] = '1';
			$image=$this->cObj->imageLinkWrap($ImgCode,$img["file"],$conf);

Ok, ich vermute das dieses JS Window sich wohl das komplette Bild lädt und daran nichts manipuliert.
Wie kann ich das Bild vor dem Laden verkleinern lassen?

Danke für Hilfe 😉

Gruss Manfred

just2b ·

Hallo Manfred,

ich machs so:

<?
  		$imgTSConfig = Array();
      $imgTSConfig = $this->conf['displaySingle.'];

  		$imgTSConfig['file'] = 'uploads/tx_rgthumbs/'.$file;
      $imgTSConfig['altText'] = $row["title"];
      $imgTSConfig['titleText'] = $row["title"];
      $imgTSConfig['file.']['maxW'] = $this->conf['singleMaxW'];
      $imgTSConfig['file.']['maxH'] = $this->conf['singleMaxH'];
      $markerArray['###IMAGE###'] =  $this->cObj->IMAGE($imgTSConfig); 	

?>

und in der ext_typoscript_setup.txt dann

displaySingle = IMAGE
displaySingle {
wrap =
imageLinkWrap = 1
imageLinkWrap {
enable = 1
bodyTag = <body bgColor="#dddddd">
wrap = <a href="javascript:close();"> | </a>
width = 1000m
height = 800
JSwindow = 1
JSwindow.newWindow = 1
JSwindow.expand = 17,20
}
stdWrap.spaceAfter=10
}

georg

BlackPixel ·

Hat WUnderbar geklappt. Hatte noch ein bischen probiert, und das ergebniss kommt Deinem ziemlich ähnlich. Ich fange an, typo3 für programmiersachen zu lieben, allerdings ist es für den Einstieg ziemlich heftig!