---
title: "wt_gallery: konstante höhe"
url: "https://www.typo3.net/d/72464-wt-gallery-konstante-hoehe"
source: "typo3.net"
tags: ["Extensions","Bilder","Frage"]
created: "2008-01-15"
last_reply: "2008-01-15"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# wt_gallery: konstante höhe

Extensions · 2 Antworten · gestartet 2008-01-15

## Eröffnungsbeitrag

**jenno** · 2008-01-15 · [Beitrag #1](https://www.typo3.net/d/72464-wt-gallery-konstante-hoehe/1)

Ich benutze die Extension wt_gallery. Hier kann man einstellen dass die Fotos eine feste Breite haben sollen. Die Breite ist mir allerdings egal, ich hätte gern eine feste Höhe. Kann ich das auch irgendwie einstellen?

## Antworten

### [#2](https://www.typo3.net/d/72464-wt-gallery-konstante-hoehe/2) · monisch · 2008-01-15

Meine Lösung ist quick and dirty: Ich habe class.tx_wtgallery_pi1.php so modifiziert, dass wenn man für die Breite "auto" im Flexform eingibt, eine feste Höhe von z.B. 300px berechnet wird:
(line 567ff.)

```php
$height = intval($width * $y / $x);	//Höhe statt Breite
	if ($width == 'auto') {
		$height = intval(300 * 1);  //Höhe 300px
		$width = intval(300 * $x / $y);
		// $width = $x; // Patch on 14.09.2007: original picture ...
	} else {
		if ( strpos($width,"m") ) { // rezize image to max width if it is too big
			$width = intval(preg_replace("/m/","",$width));
			if ( $x <= $width ) $width = $x;
		}
	}

			
	//$height = intval($width * $y / $x);
```

### [#3](https://www.typo3.net/d/72464-wt-gallery-konstante-hoehe/3) · jenno · 2008-01-15

Wow! Danke!
Ich war ja auch schon beschäftigt mit quick and dirty, aber diese Lösung ist so einfach....hab sozusagen den Wald vor lauter Bäumen nicht gesehen :o
Vielen Dank für die schnelle Reaktion!!  :D

---

Quelle: „wt_gallery: konstante höhe“, typo3.net, https://www.typo3.net/d/72464-wt-gallery-konstante-hoehe
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
