thatsimplekid
thatsimplekid

Reputation: 39

Output as an image using PHP

I'm creating a comments system for my 'CMS' and would like to implement avatars. I would like to have a "getavatar.php" that uses a GET request to find an image for a certain user, while also doing some image processing.

Could anybody point me in the right direction for outputting data as "image/png" from a php script?

An example of this would be http://placehold.it/300x300 in the way it generates a 300x300 png image from the parameters given in the URL.

Upvotes: 0

Views: 50

Answers (1)

Berriel
Berriel

Reputation: 13601

To output an image using PHP: Output an Image in PHP

To resize or edit an image using PHP: resize image in PHP

Both answers contains a lot of useful functions. Hope this help you.

Upvotes: 1

Related Questions