imagecreatefromjpg with images from db??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rainer Collet

    imagecreatefromjpg with images from db??

    hi!

    how can i use imagecreatefrom jpg if my images are stored in a database and
    not in the filesystem? imagecreatefrom jpg wants to have a filename. but i
    have only the binarycode of the image in a string. has anybody a solution
    simpler than storing the binarycode to a temp-file first?

    thanks,
    rainer


  • Jon Kraft

    #2
    Re: imagecreatefrom jpg with images from db??

    "Rainer Collet" <rainer.collet@ gmx.net> wrote:
    [color=blue]
    > how can i use imagecreatefrom jpg if my images are stored in a database
    > and not in the filesystem? imagecreatefrom jpg wants to have a
    > filename. but i have only the binarycode of the image in a string. has
    > anybody a solution simpler than storing the binarycode to a temp-file
    > first?[/color]

    Use imagecreatefrom string():


    HTH;
    JOn

    Comment

    • Rainer Collet

      #3
      Re: imagecreatefrom jpg with images from db??

      "Jon Kraft" <jon@jonux.co.u k> wrote:[color=blue]
      > Use imagecreatefrom string():
      > http://uk.php.net/manual/en/function...fromstring.php[/color]

      thanks, i should rtfm ;-)

      but what i do not understand is how does imagecreatefrom string determine the
      imagetype? is it done automaticaly?


      Comment

      • Jon Kraft

        #4
        Re: imagecreatefrom jpg with images from db??

        "Rainer Collet" <rainer.collet@ gmx.net> wrote:
        [color=blue]
        > "Jon Kraft" <jon@jonux.co.u k> wrote:[color=green]
        >> Use imagecreatefrom string():
        >> http://uk.php.net/manual/en/function...fromstring.php[/color]
        >
        > thanks, i should rtfm ;-)
        >
        > but what i do not understand is how does imagecreatefrom string
        > determine the imagetype? is it done automaticaly?[/color]

        Nope, you have to know which content type .. but you obviously already
        knew it was a JPG :)

        JOn

        Comment

        Working...