Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    922
    Thanks
    76
    Thanked 29 Times in 29 Posts

    How useful are php created images?

    Hi, well the title says it all really.

    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?

    Please let me know your thoughts.

    Regards,

    LC.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,313
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    922
    Thanks
    76
    Thanked 29 Times in 29 Posts
    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?

    Cheers for the reply.

    Regards,

    LC.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    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.



    .
    Last edited by mlseim; 11-29-2012 at 10:36 PM.

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    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.
    resistance is...

    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)

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    imagemagick is way better, but for most shared webhosts, PHP GD is easier to access and use.

  • #7
    Regular Coder
    Join Date
    Nov 2012
    Posts
    115
    Thanks
    7
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by mlseim View Post
    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.

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •