We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24731 ☆ A M B ☆
    • 211 Posts
    This bug is driving me insane and I can't seem to be able to figure out what is causing it.

    I uploaded a somewhat big image, it is 3000x2000 pixels. The thumbnail with default settings (100x100) generates correctly.

    I originally had a custom thumbnail that was 160x120, but it was coming out as a broken image. I managed to fix that by scaling the thumbnail down a bit, basically anything bellow 100 pixels height works correctly, but if I set the height to anything above 100 pixels it returns a server error.

    So I started playing with the URL to see if I could debug the problem:

    http://****.com/assets/components/gallery/connector.php?action=web/phpthumb&w=300&h=200&zc=1&far=C&q=100&src=%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F1%2F49.jpg

    Again, setting the height to anything above 100 results in a server error. If I choose something bellow 100 it generates the image.

    I tried playing around with the ZC and, far, q and all other variables in the URL but they seem to have no effect.

    I tried removing the height property and it also outputs an error.

    The more I increase the width, the lower the height needs to be in order to obtain an image without an error. I guess this has to do with the proportions of the image, but regardless what I choose I can't come up with an output I could work with.

    Any clues?
      • 24731 ☆ A M B ☆
      • 211 Posts
      I tracked the error down to a memory allocation problem:

      [23-Nov-2011 21:39:00] PHP Fatal error: Out of memory (allocated 40632320) (tried to allocate 2560 bytes) in /home/***/core/model/phpthumb/phpthumb.functions.php on line 372

      This however makes no sense to me as I have allocated 64M as memory limit. I don't get it :S.
        • 24731 ☆ A M B ☆
        • 211 Posts
        I'm getting a bit closer to this issue, based on the error and checking the files it appears that my phpthumb is using GD as default instead of image magick which is installed. How can I force phpthumb to use imagemagick? I have already set the correct path in the settings on the manage but that doesn't seem to work.
          • 24731 ☆ A M B ☆
          • 211 Posts
          ok, more info, it seems that I am using imagick after all but it seems to be buggy or something. I just tested removing the module form php.ini and the image generation works correctly. If I enable the module again it does not work. So perhaps there is something wrong with my image magick setup :S.
            • 24731 ☆ A M B ☆
            • 211 Posts
            I got to the bottom of this issue, it turned out to be a server configuration problem. The RlimitMem for apache was set to a low value and was causing php to run out of memory. After increasing it and rebuilding httpd.conf things worked perfectly.
              • 14372
              • 49 Posts
              I must thank you for the resolve to keep posting even when no one answered. What you posted here had given me a clue into what might be the issue ... thanks.

              Ps: I'm using Nginx instead of Apache but none the less, if memory is the issue then it doesn't matter.