ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Forum thumbnails not working

February 13, 2011 9:15pm

Subscribe [5]
  • #1 / Feb 13, 2011 9:15pm

    eeart

    257 posts

    On our forum uploaded images are not being automatically resized to thumbnails.

    We have set “Use Thumbnails of Uploaded Images in Posts” to Yes. Image Resizing Preferences is set to ImageMagick and the path is set correctly. It doesn’t work with GD either, which is installed.

    In mod.forum_code.php the resizing happens here:

    $this->EE->load->library('image_lib', $res_config); 
    if ($this->EE->image_lib->resize())
    {
    ...

    But $this->EE->image_lib->resize() is false, so it doesn’t go through with the resizing.

    What could the reason of this be?

    Thanks

  • #2 / Feb 13, 2011 9:21pm

    eeart

    257 posts

    Mmm, if I look in Image_lib.php I find this:

    function resize()
    {
        $protocol = 'image_process_'.$this->image_library;
        
        if (preg_match('/gd2$/i', $protocol))
        {
            $protocol = 'image_process_gd';
        }
    
        return $this->$protocol('resize');
    }

    This looks like it would only accept GD 2 ???

    If I set Image Resizing Preferences to GD 2 then $protocol here is still “image_process_imagemagick”.

    If I hack in the line $protocol = ‘image_process_gd2’ the image gets resized on the forum, but the colors are not right.

  • #3 / Feb 14, 2011 8:25am

    Sue Crocker

    26054 posts

    Hi, eeart.

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

  • #4 / Feb 15, 2011 1:20am

    eeart

    257 posts

    We’re on EE 2.1.3 build 20101220

  • #5 / Feb 15, 2011 3:31pm

    Ingmar

    29245 posts

    Do you have access to GD2? When you run the server wizard, what results do you get?

  • #6 / Feb 15, 2011 3:41pm

    eeart

    257 posts

    I ran ee_wizard and everything in the Supported column says Yes.

    But I want to keep Imagemagick as our Image Resizing Protocol.

  • #7 / Feb 16, 2011 12:13am

    John Henry Donovan

    12339 posts

    eeart,

    What version and build of the Discussion Forum are you using?

    Let’s test ImageMagick while we are at it

    Create a file call imtest.php with the following content. Upload it to your root

    <html> <head> <title>Test for ImageMagick</title> </head>
    <body> <?
    function alist ($array) {  //This function prints a text array as an html list.
      $alist = "<ul>";
      for ($i = 0; $i < sizeof($array); $i++) {
        $alist .= "<li>$array[$i]";
      }
      $alist .= "</ul>";
      return $alist;
    }
    exec("convert -version", $out, $rcode); //Try to get ImageMagick "convert" program version number.
    echo "Version return code is $rcode 
    "; //Print the return code: 0 if OK, nonzero if error.
    echo alist($out); //Print the output of "convert -version"
    
    ?> </body> </html>


    load the page up in your browser

    If you have access to “convert,” you will get a return code of 0 plus two or three lines of text, reporting the version and location of ImageMagick.

  • #8 / Feb 16, 2011 1:17am

    eeart

    257 posts

    Imagemagick works fine on other things. The result is:

    Version return code is 0
    
        * Version: ImageMagick 6.2.8 10/20/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
        * Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
  • #9 / Feb 16, 2011 2:12pm

    Sue Crocker

    26054 posts

    Quick question - are you using a standard forum template?

  • #10 / Feb 17, 2011 4:25pm

    eeart

    257 posts

    We do use the default forum template but it has been modified.

  • #11 / Feb 18, 2011 3:37am

    John Henry Donovan

    12339 posts

    eeart,

    Before we go in for a look can you quickly switch to another default template and see if issue persists?

  • #12 / Feb 18, 2011 12:19pm

    eeart

    257 posts

    Changing the forum theme does not make a difference.

    We are now also getting an Internal Server Error when resizing images in CP. If I change the Image Resizing Preference from ImageMagick to GD the error goes away and the image gets resized.

    But on the forum GD doesn’t work either; the image becomes all blue.

  • #13 / Feb 19, 2011 2:27pm

    Greg Salt

    3988 posts

    Hi eeart,

    Can you please confirm the Discussion Forum module version and build you have installed? Are thumbnails created properly and working elsewhere within your site?

    Cheers

    Greg

  • #14 / Feb 20, 2011 6:40pm

    eeart

    257 posts

    Discussion Forum 3.1.2
    EE 2.1.3 build 20101220

    Are thumbnails created properly and working elsewhere within your site?

    Yes and no:

    1. Resizing is working perfectly with member photos (using ImageMagick) and in my own scripts (both GD and ImageMagick work)
    2. In CP resizing an image in the File Manager results in an “Internal Server Error” when the preference is set to ImageMagick. If I change it GD this works fine.
    3. In the forum image attachments don’t get resized at all when set to ImageMagick, but if I set it to GD images are resized and become blue (see attachment)

    We want to keep it on ImageMagick as we have an area on the website where members can upload very large images and this doesn’t work with GD.

  • #15 / Feb 21, 2011 10:18am

    Sue Crocker

    26054 posts

    You mentioned GD, do you have GD2? They’re different.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases