clarification needed about libgd and imagejpg()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Giovanni Gherdovich

    clarification needed about libgd and imagejpg()

    Hello,

    I had no success in making libgd working with
    PHP (I run a linux system). It seems that my
    libgd cannot handle jpg files.

    When I run on my webserver the script

    <?php
    var_dump(gd_inf o());
    ?>

    I get this output:

    array(11) {
    ["GD Version"]= string(27) "bundled (2.0.34
    compatible)"
    ["FreeType Support"]= bool(false)
    ["T1Lib Support"]= bool(false)
    ["GIF Read Support"]= bool(true)
    ["GIF Create Support"]= bool(true)
    ["JPG Support"]= bool(false)
    ["PNG Support"]= bool(true)
    ["WBMP Support"]= bool(true)
    ["XPM Support"]= bool(false)
    ["XBM Support"]= bool(true)
    ["JIS-mapped Japanese Font Support"]= bool(false) }

    from wich is quite clear that I cannot handle jpg files;
    but why? Do I need an extra library?

    If I run some scripts, I get the error
    "Call to undefined function imagejpeg() in ..."

    Thankyou in advance.

    Best regards,
    Giovanni Gherdovich
  • Guillaume

    #2
    Re: clarification needed about libgd and imagejpg()

    Giovanni Gherdovich a écrit :
    from wich is quite clear that I cannot handle jpg files;
    but why? Do I need an extra library?
    libjpeg.


    Apache configuration --with-jpeg-dir=****

    Regards,
    --
    Guillaume

    Comment

    • Giovanni Gherdovich

      #3
      Re: clarification needed about libgd and imagejpg()

      Thankyou Guillame for the reply.
      Mmmh.. I already had libjpeg in my system.

      I tried to locate my libjpeg files and I got

      /usr/lib/libjpeg.a
      /usr/lib/libjpeg.la
      /usr/lib/libjpeg.so
      /usr/lib/libjpeg.so.62
      /usr/lib/libjpeg.so.62.0 .0

      so I recompiled PHP adding --with-jpeg-dir=/usr/lib

      and the output from configure was

      [...]
      checking for GD support... yes
      checking for the location of libjpeg... /usr/lib
      checking for the location of libpng... no
      [...]

      (before it was "checking for the location of libjpeg... no")

      But I still don't have jpeg support with GD...
      (the output from gd_info() is the same as above,
      and it doesn't find imagejpg())

      It's strange that PHP doesn't find libpng while
      configuring, but from gd_info() it seems I have
      png support.
      Apache configuration --with-jpeg-dir=****
      Do you mean that I must recompile Apache,
      instead of PHP?

      Here

      I've read that also the gd library itself must be
      compiled with jpeg support...

      I don't have the whole picture very clear.
      Any hint?

      Regards,
      GGhh

      Comment

      • Guillaume

        #4
        Re: clarification needed about libgd and imagejpg()

        Giovanni Gherdovich a écrit :
        >Apache configuration --with-jpeg-dir=****
        >
        Do you mean that I must recompile Apache,
        instead of PHP?
        My bad, I was thinking PHP ^^

        Still I have no other clue regarding the problem... It perfectly worked
        for me. Plus I should say that I'm not compiling PHP every day :p

        Regards,
        --
        Guillaume

        Comment

        • Rik Wasmus

          #5
          Re: clarification needed about libgd and imagejpg()

          On Wed, 19 Mar 2008 18:39:16 +0100, Guillaume <ggrason@gmail. comwrote:
          Giovanni Gherdovich a écrit :
          >>Apache configuration --with-jpeg-dir=****
          > Do you mean that I must recompile Apache,
          >instead of PHP?
          My bad, I was thinking PHP ^^
          >
          Still I have no other clue regarding the problem... It perfectly worked
          for me. Plus I should say that I'm not compiling PHP every day :p
          I'd say this:
          "When buliding the jpeg-v6b library (prior to building PHP) you must use
          the --enable-shared option in the configure step. If you do not, you will
          receive an error saying libjpeg.(a|so) not found when you get to the
          configure step of building PHP."

          The wonders of installation instructions: <http://nl2.php.net/gd>
          --
          Rik Wasmus

          Comment

          Working...