X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=news.php;h=b729bb7f046f955844ea7100302214d29f8b406b;hp=9bdefd18cc54da0821569ad5a97956d75804b080;hb=9acc365249b5e630da6b5cdd23e3a8015f39ddc7;hpb=ae3851e4befcc7f6bee6d161dc77ac2e4e9c6515 diff --git a/news.php b/news.php index 9bdefd1..b729bb7 100644 --- a/news.php +++ b/news.php @@ -87,6 +87,17 @@ function main ($features) { $contentHTML = sprintf ("

%s

", htmlspecialchars ($feature->title, ENT_QUOTES)); } + // FIXME: we consider thumbnail are correctly sized if gd library is + // installed. That may not always be true. For example if gd was installed + // after images were initially uploaded. + if (function_exists ("imagecreatefromjpeg")) { + if ($feature->imgpath) { + $imgurl = image_url_from_imgpath ($feature->imgpath); + $thumburl = thumb_url_from_imgpath ($feature->imgpath); + $contentHTML .= sprintf ('%s', $imgurl, $alt, $thumburl); + } + } + if (strlen ($contentHTML) != 0) { printf (" %s