How useful are php created images and are they really necessary to learn? Can anyone give me any examples of when you would use such a thing? I've seen an example where you can ask the user to create an image but if you're not creating that type of website, is it worth learning?
Well that depends what you want to do. If you want to setup an online equivalent of photoshop then you've got a lot to learn.
If you just want to create captcha images then you can find a class at white hat web design that'll do the job nicely.
It really depends what you need to know. I've never bothered learning to deal with images in php as I don't need it or ever intend to deal with images. Should the time ever come that I need to overly watermarks etc, I'm sure there will be a class I can use, hack, customise etc.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
I just saw an example of images including a captcha and thought it would be a cool little feature to add. It seems it is a whole new area of php though and don't think I'm up to that task just yet. Just wanted some advice on the most common features of PHP images.
Could you explain in laymans terms about the concept of an overlay? Is it the same as when you go on an image site and they print their name/logo onto the front to prevent people from stealing them?
You actually create a real .jpg image with some text or pattern embedded on top of the photo.
Anything you display on the internet can be copied. You can only control the quality of the image.
You give users a watermarked, reduced resolution, or crappy quality.
If they copy it, that's what they get.
You may want to create a graphic image for a user that enters text on a form.
Here's sort of a 'sappy' example: http://www.catpin.com/card_sample/
The idea is to show the rendered image is really an image, not HTML.
and lots of other uses.. I use Zend's barcode library to create barcodes which are saved as images for printing labels etc, you can also (generate &) display emails as images to avoid scraping etc, creating thumbnails of user uploaded images, I have a dodgy label printer which I can't get working with the PHP printer draw functions but can get it to print an image so I create the image (serial/job numbers etc) and print that instead.
I am currently working on a valuation system that will show e.g. a picture of a diamond and then (how I have not worked out yet ) allow the valuer to mark where the inclusions are, then I will combine the 2 images to produce an image for the valuation report.
To be fair I mostly use imagemagick rather than PHP's image functions but either way its useful from time to time.
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
imagemagick is way better, but for most shared webhosts, PHP GD is easier to access and use.
True, mainly because ImageMagick in some form needs the exec() function to work, which is by default disabled on pretty much all shared hosting providers.
I did discover though, that ImageMagick is available and works great using Perl
instead of PHP (at least available on the few shared webhosts I'm using). Fortunately,
I know Perl so this isn't an issue ... but most people on this section of the forum (PHP)
wouldn't be using Perl.