Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2012, 05:48 PM   PM User | #1
LearningCoder
Regular Coder

 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: The Pleiades
Posts: 849
Thanks: 67
Thanked 28 Times in 28 Posts
LearningCoder is an unknown quantity at this point
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.
LearningCoder is offline   Reply With Quote
Old 11-29-2012, 09:04 PM   PM User | #2
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,503
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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 wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//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. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 11-29-2012, 10:09 PM   PM User | #3
LearningCoder
Regular Coder

 
LearningCoder's Avatar
 
Join Date: Jan 2011
Location: The Pleiades
Posts: 849
Thanks: 67
Thanked 28 Times in 28 Posts
LearningCoder is an unknown quantity at this point
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.
LearningCoder is offline   Reply With Quote
Old 11-29-2012, 10:31 PM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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..
mlseim is offline   Reply With Quote
Old 11-30-2012, 03:50 PM   PM User | #5
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,896
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
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)
firepages is offline   Reply With Quote
Old 11-30-2012, 05:05 PM   PM User | #6
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
imagemagick is way better, but for most shared webhosts, PHP GD is easier to access and use.
mlseim is offline   Reply With Quote
Old 11-30-2012, 06:21 PM   PM User | #7
Thyrosis
New Coder

 
Join Date: Nov 2012
Posts: 72
Thanks: 4
Thanked 11 Times in 11 Posts
Thyrosis is on a distinguished road
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.
Thyrosis is offline   Reply With Quote
Old 11-30-2012, 10:21 PM   PM User | #8
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
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.
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:45 AM.


Advertisement
Log in to turn off these ads.