]> dev.renevier.net Git - syp.git/blobdiff - news.php
create thumbnails of photos
[syp.git] / news.php
index 9bdefd18cc54da0821569ad5a97956d75804b080..b729bb7f046f955844ea7100302214d29f8b406b 100644 (file)
--- a/news.php
+++ b/news.php
@@ -87,6 +87,17 @@ function main ($features) {
             $contentHTML = sprintf ("<p>%s</p>", htmlspecialchars ($feature->title, ENT_QUOTES));
         }
 
             $contentHTML = sprintf ("<p>%s</p>", 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 ('<a href="%s"><img alt="%s" src="%s"></a>', $imgurl, $alt, $thumburl);
+            }
+        }
+
         if (strlen ($contentHTML) != 0) {
             printf ("       <content type=\"html\">
                 %s
         if (strlen ($contentHTML) != 0) {
             printf ("       <content type=\"html\">
                 %s