FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Opening any image with PHP. Couldn't find anywhere.





The-Master
Well so far I have made This So that any url of a php file at the end of the url becomes the image.

What I want to do is have it so that the image does not have to be a png, it can be any image. The only way i can think of doing this is by using a @$_GET['imagetype'] I don't know if that would work though. Also I would like it if it could just open any image.

Please help. Thanks Very Happy
Esch
You might have better luck using pathinfo($url) to first get the extension of the file you're trying to alter -- pathinfo returns an associative array, so the extension is located in $return_value['extension']. Once you have that, you can decide which of the various imagecreatefrom*() functions to call based on the extension. By the way, note that the extension has no initial period; it's just "jpg", "jpeg", or "gif".

(On a side note, since GD can only deal with a few formats, I think that it makes more sense for them to have several functions that expect a specific file format, rather than have one catch-all function that throws an error when it gets a file format it can't understand, I think.)

I hope that helps somewhat.
Related topics
Show off corner
Dynamic PHP Images
Importing an existing database...
Newbie question - file size/type?
php mailing script
THE SMALLEST ITEM EVER SOLD ON eBay!
User ranks?
How to create a php files that contain a image ?
Text Based Game - Using PHP
image php sripting that made a image refreshed every loaded
Editing SMF forum main menu
combine A4 Size
PHP Image crop
How to resizer you images with VSO Image Resizer
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.