Mailinglisten-Archive |
Jens Reinemuth schrieb:
> [...]
> if (!file_exists($strThumb)) {
> $arrSize = getimagesize($strEntry);
> switch ($arrSize[2]) {
> case 2:
> $imgInput = imagecreatefromjpeg($strEntry);
> break;
> case 3:
> $imgInput = imagecreatefrompng($strEntry);
> break;
> }
> list($width, $height) = getimagesize($strEntry);
Warum rufst du getimagesize() zweimal auf?
> $new_width = $maxWidth;
> $new_height = $maxHeight;
> ($maxWidth && ($width < $height)) ? $new_width = ($maxHeight / $height) *
> $width : $new_height = ($maxWidth / $width) * $height;
> $imgOutput = imagecreatetruecolor($new_width, $new_height);
> imagecopyresampled($imgOutput, $imgInput, 0, 0, 0, 0, $new_width,
> $new_height, $width, $height);
> imagepng($imgOutput,$strThumb);
Hier fehlt das imagedestroy() für die beiden Bilder.
> }
> }
>
> Dieses führt dazu, dass der Apache sich bei 95% Prozessorlast einpendelt und
> so ca. 20 Bilder pro Minute als Thumbs anlegt...
das ist wirklich sehr langsam, dass stimmt wohl was nicht ...
--
Sebastian Mendel
www.sebastianmendel.de
php::bar PHP Wiki - Listenarchive