How can a GIF image < 1KB use up 100+mb of memory with imagecreatefromgif()?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • comp.lang.php

    How can a GIF image < 1KB use up 100+mb of memory with imagecreatefromgif()?

    re:


    I am trying only this:

    [PHP]
    $image = @imagecreatefro mgif('/path/to/this/image.gif');
    [/PHP]

    This line alone causes a segfault on my machine; when I measured how
    much memory it took to process this, it literally required up to 100+mb
    of memory to process a GIF image that is only 953 bytes!!!

    Is this normal behavior for imagecreatefrom gif()? I am using PHP 4.3.9
    with GD 2.0.1, this shouldn't happen but it does

    Phil

  • NC

    #2
    Re: How can a GIF image &lt; 1KB use up 100+mb of memory with imagecreatefrom gif()?

    comp.lang.php wrote:
    re:

    >
    I am trying only this:
    >
    [PHP]
    $image = @imagecreatefro mgif('/path/to/this/image.gif');
    [/PHP]
    >
    This line alone causes a segfault on my machine; when I measured how
    much memory it took to process this, it literally required up to 100+mb
    of memory to process a GIF image that is only 953 bytes!!!
    >
    Is this normal behavior for imagecreatefrom gif()?
    No. It's possible your copy of GD is damaged. Try reinstalling GD.

    Cheers,
    NC

    Comment

    • Andy Hassall

      #3
      Re: How can a GIF image &lt; 1KB use up 100+mb of memory with imagecreatefrom gif()?

      On 5 Oct 2006 15:00:35 -0700, "comp.lang. php" <phillip.s.powe ll@gmail.com>
      wrote:
      Re what page from this search?
      >I am trying only this:
      >
      >[PHP]
      >$image = @imagecreatefro mgif('/path/to/this/image.gif');
      >[/PHP]
      >
      >This line alone causes a segfault on my machine; when I measured how
      >much memory it took to process this, it literally required up to 100+mb
      >of memory to process a GIF image that is only 953 bytes!!!
      If it segfaults, get a backtrace and report it as a bug.


      >Is this normal behavior for imagecreatefrom gif()? I am using PHP 4.3.9
      >with GD 2.0.1, this shouldn't happen but it does
      Given this isn't the first GD memory-related post you've made then there's
      either something badly wrong with your installation or you're doing something
      other than what you're describing.

      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • comp.lang.php

        #4
        Re: How can a GIF image &lt; 1KB use up 100+mb of memory with imagecreatefrom gif()?


        NC wrote:
        comp.lang.php wrote:
        re:


        I am trying only this:

        [PHP]
        $image = @imagecreatefro mgif('/path/to/this/image.gif');
        [/PHP]

        This line alone causes a segfault on my machine; when I measured how
        much memory it took to process this, it literally required up to 100+mb
        of memory to process a GIF image that is only 953 bytes!!!

        Is this normal behavior for imagecreatefrom gif()?
        >
        No. It's possible your copy of GD is damaged. Try reinstalling GD.
        >
        I am not capable of doing that on this particular machine as I don't
        have root privileges onto it and the only ones who do are no longer
        authorized to do any administrative work on this particular machine, so
        I'm not sure what I could do as a workaround for this, but I am truly
        suspecting that there is something within either PHP or GD, as others
        pointed out, causing this to frequently occur and requires an upgrade
        of both.

        Thanx
        Phil
        Cheers,
        NC

        Comment

        Working...