createimagefromstring / createimagefromjpeg

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Moschkin

    #1

    createimagefromstring / createimagefromjpeg

    I've tried uploading a couple of jpegs to my test application, thinking
    that it was some how a header problem, and since I know these jpegs were
    created with different programs, I figured I could root that out as the
    cause.

    My problem? Either of these functions, when attempting to load a JPEG
    on my system are failing... they're causing PHP to crash and end the
    script right then and there and I can't find any error logs that give me
    any more information than that.

    I've checked my memory limits and all of that, that's not the problem,
    since I can load the contents of the file into a string, just fine... I
    just cannot use the createimage functions.

    I'm hoping someone's run into this problem, before, so I'm hoping
    someone here can point me in the right direction with this one.

    Thanks in advance!
  • Twayne

    #2
    Re: createimagefrom string / createimagefrom jpeg

    I've tried uploading a couple of jpegs to my test application,
    thinking that it was some how a header problem, and since I know
    these jpegs were created with different programs, I figured I could
    root that out as the cause.
    >
    My problem? Either of these functions, when attempting to load a JPEG
    on my system are failing... they're causing PHP to crash and end the
    script right then and there and I can't find any error logs that give
    me any more information than that.
    >
    I've checked my memory limits and all of that, that's not the problem,
    since I can load the contents of the file into a string, just fine...
    I just cannot use the createimage functions.
    >
    I'm hoping someone's run into this problem, before, so I'm hoping
    someone here can point me in the right direction with this one.
    >
    Thanks in advance!
    Maybe: Check out how Captcha images are done; that's what I learned on.
    Not the same, but similar processes; it just also creates its own image,
    so toss that part.


    Comment

    • Jerry Stuckle

      #3
      Re: createimagefrom string / createimagefrom jpeg

      Nathan Moschkin wrote:
      I've tried uploading a couple of jpegs to my test application, thinking
      that it was some how a header problem, and since I know these jpegs were
      created with different programs, I figured I could root that out as the
      cause.
      >
      My problem? Either of these functions, when attempting to load a JPEG
      on my system are failing... they're causing PHP to crash and end the
      script right then and there and I can't find any error logs that give me
      any more information than that.
      >
      I've checked my memory limits and all of that, that's not the problem,
      since I can load the contents of the file into a string, just fine... I
      just cannot use the createimage functions.
      >
      I'm hoping someone's run into this problem, before, so I'm hoping
      someone here can point me in the right direction with this one.
      >
      Thanks in advance!
      >
      How big are the jpegs? Just because you can load them into a string
      doesn't mean you can use createimage(). That can take significantly
      more memory.

      The first thing you should do is enable all error reporting and display
      errors. In your php.ini file, set

      error_reporting =E_ALL
      display_errors= on

      You should always have these enabled on a development system (but not a
      production system).

      If you still don't see the problem, post your code and we can look at it.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Nathan Moschkin

        #4
        Re: createimagefrom string / createimagefrom jpeg

        Jerry Stuckle wrote:
        >
        How big are the jpegs? Just because you can load them into a string
        doesn't mean you can use createimage(). That can take significantly
        more memory.
        >
        The first thing you should do is enable all error reporting and display
        errors. In your php.ini file, set
        >
        error_reporting =E_ALL
        display_errors= on
        >
        You should always have these enabled on a development system (but not a
        production system).
        >
        If you still don't see the problem, post your code and we can look at it.
        >

        I figured it out. My system wasn't configured properly. I was missing
        the php-gd libraries installed on my system. I installed them and
        everything instantly started working.

        You know, I'm going to be working with exceptionally large files. Is
        there any way to overcome the inherent 2 GB limit in PHP?

        Comment

        • burgermeister01@gmail.com

          #5
          Re: createimagefrom string / createimagefrom jpeg

          On Jul 7, 3:51 am, Nathan Moschkin <ironyw...@veri zon.netwrote:
          I've tried uploading a couple of jpegs to my test application, thinking
          that it was some how a header problem, and since I know these jpegs were
          created with different programs, I figured I could root that out as the
          cause.
          >
          My problem?  Either of these functions, when attempting to load a JPEG
          on my system are failing... they're causing PHP to crash and end the
          script right then and there and I can't find any error logs that give me
          any more information than that.
          >
          I've checked my memory limits and all of that, that's not the problem,
          since I can load the contents of the file into a string, just fine... I
          just cannot use the createimage functions.
          >
          I'm hoping someone's run into this problem, before, so I'm hoping
          someone here can point me in the right direction with this one.
          >
          Thanks in advance!
          I'd still think it may be some kind of memory or other resource
          related issue. Have you tried processing a very small image, say some
          1x1 px image? If that works, I'd say it's probably a memory issue. I
          also remember on a previous webhost I had that sucked, Globat.com,
          they used to restrict CPU cycles. So I had some CPU intensive image
          manipulation scripts that would often fail because of their super
          restricitive web server. That might be something else to investigate.

          Comment

          • AnrDaemon

            #6
            Re: createimagefrom string / createimagefrom jpeg

            Greetings, Nathan Moschkin.
            In reply to Your message dated Tuesday, July 8, 2008, 0:59:25,
            >How big are the jpegs? Just because you can load them into a string
            >doesn't mean you can use createimage(). That can take significantly
            >more memory.
            >>
            >The first thing you should do is enable all error reporting and display
            >errors. In your php.ini file, set
            >>
            >error_reportin g=E_ALL
            >display_errors =on
            >>
            >You should always have these enabled on a development system (but not a
            >production system).
            >>
            >If you still don't see the problem, post your code and we can look at it.
            >>
            I figured it out. My system wasn't configured properly. I was missing
            the php-gd libraries installed on my system. I installed them and
            everything instantly started working.
            You know, I'm going to be working with exceptionally large files. Is
            there any way to overcome the inherent 2 GB limit in PHP?
            What you mean 'exceptionally' ? 4000x3000x32b = about 45Mb.
            memory_limit 128Mb will be most likely more than enough for you.


            --
            Sincerely Yours, AnrDaemon <anrdaemon@free mail.ru>

            Comment

            • Jerry Stuckle

              #7
              Re: createimagefrom string / createimagefrom jpeg

              Nathan Moschkin wrote:
              Jerry Stuckle wrote:
              >>
              >How big are the jpegs? Just because you can load them into a string
              >doesn't mean you can use createimage(). That can take significantly
              >more memory.
              >>
              >The first thing you should do is enable all error reporting and
              >display errors. In your php.ini file, set
              >>
              >error_reportin g=E_ALL
              >display_errors =on
              >>
              >You should always have these enabled on a development system (but not
              >a production system).
              >>
              >If you still don't see the problem, post your code and we can look at it.
              >>
              >
              >
              I figured it out. My system wasn't configured properly. I was missing
              the php-gd libraries installed on my system. I installed them and
              everything instantly started working.
              >
              You know, I'm going to be working with exceptionally large files. Is
              there any way to overcome the inherent 2 GB limit in PHP?
              >
              It's not a PHP limitation as much as a machine one. Get a 64 bit
              processor and software. Then you'll have lots of memory.

              But why would you EVER need more than 2GB for PHP? I've never used more
              than 128MB or so - even on the heaviest systems.



              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Nathan Moschkin

                #8
                Re: createimagefrom string / createimagefrom jpeg

                Jerry Stuckle wrote:
                It's not a PHP limitation as much as a machine one. Get a 64 bit
                processor and software. Then you'll have lots of memory.
                >
                But why would you EVER need more than 2GB for PHP? I've never used more
                than 128MB or so - even on the heaviest systems.
                >
                I'm running on a 64 bit processor. That means I could upload 4 GB files?

                I'm developing a digital asset management website... and some of the
                clients for the company develop bus wraps ... that is, one gigantic
                graphic image that wraps around, say ... a city bus... and those files
                are on the border between massive and colossal.

                Comment

                • Jerry Stuckle

                  #9
                  Re: createimagefrom string / createimagefrom jpeg

                  Nathan Moschkin wrote:
                  Jerry Stuckle wrote:
                  >
                  >It's not a PHP limitation as much as a machine one. Get a 64 bit
                  >processor and software. Then you'll have lots of memory.
                  >>
                  >But why would you EVER need more than 2GB for PHP? I've never used
                  >more than 128MB or so - even on the heaviest systems.
                  >>
                  >
                  I'm running on a 64 bit processor. That means I could upload 4 GB files?
                  >
                  I'm developing a digital asset management website... and some of the
                  clients for the company develop bus wraps ... that is, one gigantic
                  graphic image that wraps around, say ... a city bus... and those files
                  are on the border between massive and colossal.
                  >
                  >
                  File upload size has nothing to do with PHP memory size.

                  And if you're running on a 64 bit processor - are you using all 64 bit
                  software, also? From the OS on down?

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Nathan Moschkin

                    #10
                    Re: createimagefrom string / createimagefrom jpeg

                    Jerry Stuckle wrote:
                    Nathan Moschkin wrote:
                    >Jerry Stuckle wrote:
                    >>
                    >>It's not a PHP limitation as much as a machine one. Get a 64 bit
                    >>processor and software. Then you'll have lots of memory.
                    >>>
                    >>But why would you EVER need more than 2GB for PHP? I've never used
                    >>more than 128MB or so - even on the heaviest systems.
                    >>>
                    >>
                    >I'm running on a 64 bit processor. That means I could upload 4 GB files?
                    >>
                    >I'm developing a digital asset management website... and some of the
                    >clients for the company develop bus wraps ... that is, one gigantic
                    >graphic image that wraps around, say ... a city bus... and those files
                    >are on the border between massive and colossal.
                    >>
                    >>
                    >
                    File upload size has nothing to do with PHP memory size.
                    >
                    And if you're running on a 64 bit processor - are you using all 64 bit
                    software, also? From the OS on down?
                    >
                    openSUSE 11.0 AMD 64 compile. 2 Gig of ram, nice 350 GB drive ... this
                    is just my development platform... the live system will be hosted by a
                    professional web hosting service with RAID arrays, clustering and all
                    that jazz...

                    at any rate .. I was under the impression that the two did have
                    something tied into one another, all the books state that your memory
                    size should always be greater than your post size, and that should
                    always be greater than max file size.

                    Comment

                    • Jerry Stuckle

                      #11
                      Re: createimagefrom string / createimagefrom jpeg

                      Nathan Moschkin wrote:
                      Jerry Stuckle wrote:
                      >Nathan Moschkin wrote:
                      >>Jerry Stuckle wrote:
                      >>>
                      >>>It's not a PHP limitation as much as a machine one. Get a 64 bit
                      >>>processor and software. Then you'll have lots of memory.
                      >>>>
                      >>>But why would you EVER need more than 2GB for PHP? I've never used
                      >>>more than 128MB or so - even on the heaviest systems.
                      >>>>
                      >>>
                      >>I'm running on a 64 bit processor. That means I could upload 4 GB
                      >>files?
                      >>>
                      >>I'm developing a digital asset management website... and some of the
                      >>clients for the company develop bus wraps ... that is, one gigantic
                      >>graphic image that wraps around, say ... a city bus... and those
                      >>files are on the border between massive and colossal.
                      >>>
                      >>>
                      >>
                      >File upload size has nothing to do with PHP memory size.
                      >>
                      >And if you're running on a 64 bit processor - are you using all 64 bit
                      >software, also? From the OS on down?
                      >>
                      >
                      openSUSE 11.0 AMD 64 compile. 2 Gig of ram, nice 350 GB drive ... this
                      is just my development platform... the live system will be hosted by a
                      professional web hosting service with RAID arrays, clustering and all
                      that jazz...
                      >
                      at any rate .. I was under the impression that the two did have
                      something tied into one another, all the books state that your memory
                      size should always be greater than your post size, and that should
                      always be greater than max file size.
                      >
                      >
                      Yes, memory size needs to be big enough - but not necessarily as big as
                      the file. It is sent in chunks, not as all one packet.

                      And PHP memory size has no bearing on upload file size. The web server
                      handles the transfer of the file to your temp directory (usually /tmp).
                      Once it has been uploaded, PHP gets control.

                      PHP has nothing to do with the actual file transfer.

                      BTW - have you though of how long it's going to take to transfer a 4GB
                      file, and what that's going to do to your allocated bandwidth for the
                      server? It could get expensive real quick.

                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • Nathan Moschkin

                        #12
                        Re: createimagefrom string / createimagefrom jpeg

                        Jerry Stuckle wrote:
                        >
                        Yes, memory size needs to be big enough - but not necessarily as big as
                        the file. It is sent in chunks, not as all one packet.
                        >
                        And PHP memory size has no bearing on upload file size. The web server
                        handles the transfer of the file to your temp directory (usually /tmp).
                        Once it has been uploaded, PHP gets control.
                        >
                        PHP has nothing to do with the actual file transfer.
                        >
                        BTW - have you though of how long it's going to take to transfer a 4GB
                        file, and what that's going to do to your allocated bandwidth for the
                        server? It could get expensive real quick.
                        >
                        Thank you very much for that useful bit of information, and yes, the
                        people I'm doing the project for, and I have thought of everything in
                        this regard.

                        They're in the business of catering to people who need that capability
                        .... and they're quite prepared to handle band-width and metering issues.

                        Comment

                        Working...