Creating an image file with only PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Jay Salzman

    Creating an image file with only PHP

    Is it possible to create an image file from a string using only functions
    from core PHP (in other words, without 3rd party libraries/applications)?

    I'm interested in any image file that is displayable without plugins or
    helper applications, like jpg, png, gif.

    Thanks!
  • Justin Koivisto

    #2
    Re: Creating an image file with only PHP

    Peter Jay Salzman wrote:[color=blue]
    > Is it possible to create an image file from a string using only functions
    > from core PHP (in other words, without 3rd party libraries/applications)?
    >
    > I'm interested in any image file that is displayable without plugins or
    > helper applications, like jpg, png, gif.
    >
    > Thanks![/color]


    "Note: Since PHP 4.3 there is a bundled version of the GD lib. This
    bundled version has some additional features like alpha blending, and
    should be used in preference to the external library since its codebase
    is better maintained and more stable."

    Therefore, if you are using php 4.3 or better, the functions are there.
    You'd need to test for supported types and such since I believe it does
    depend on what the server system supports. I usually use things like

    if(function_exi sts('imagepng') )

    to check if a certain type is supported on the server.


    HTH

    --
    Justin Koivisto, ZCE - justin@koivi.co m

    Comment

    Working...