NYCPHP Meetup

NYPHP.org

[nycphp-talk] Creating Avatar Images

Khalid Hanif phplists at jellyandcustard.com
Fri Oct 12 04:19:09 EDT 2007


On 12 Oct 2007, at 01:27, Ben Sgro ((ProjectSkyLine)) wrote:

> I want to allow users to upload images (.png, .jpg, .jpeg, gif,  
> etc) to use
> as an avatar for an online application.
>
> What's the best 3rd party lib for doing this. It will need to  
> resize to approriate
> sizes (maybe even convert to a common format)

http://pear.php.net/package/Image_Transform

or

http://pecl.php.net/package/imagick or use the GD Library - it's  
really not that hard...

> and I need it to be secure,
> no "file.gif.php" or #> cat "<?php phpinfo(); ?>" > img.php hacks.

Check for the file's mimetype via:

http://pecl.php.net/package/Fileinfo (some docs on this: http:// 
www.jellyandcustard.com/2006/01/19/php-mime-types-and-fileinfo/ )

Or via the command line:

/usr/bin/file -i filename.ext (your location of the file program may  
vary)

Khalid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071012/9e1bfd09/attachment.html>


More information about the talk mailing list