tags:

views:

89

answers:

1

Hello, I have to work with different kinds of images with PHP&&GD. The images have extensions like png,jpg and other. How can i upload them into resources. For example, there is function CreateImageFromJPEG, but I'll not be able to load other types of images. How can I write template for all types I need?

+2  A: 

If I understand correctly, you want to be able to open files of other types then JPEG? Read in the contents of the file using standard methods (e.g. using fread) and then use imagecreatefromstring() which autodetects the file type.

If you have to support some more exotic file types not supported by GD, you should look into ImageMagick.

pafcu