Photo upload and cropping PHP class
/**
- Description of Photo
- The purpose of the class is to take an image that has been / is being uploaded through a http upload
- The various validation methods will still need to be observed and created as the class does not handle that
- Largely due to the fact that certain restrictions may change from program to program
- This class can take the uploaded image, move it and rename it.
- It also can take the image and make a square crop of the image.
- The class can also resize the image while keeping the original ratios
- PLEASE NOTE:: the gd lib is required for this (sudo apt-get install php5-gd)
- usage :
- $photo = new Photo($image);
- $photo->set_orig_name($_FILES['file']['name']);
- $photo->set_new_name(time() . '-' . md5($email));
- $photo->set_orig_dir('uploaded_files/full_orig/');
- $photo->set_cropped_dir('uploaded_files/');
- $photo->save_orig();
- $photo->square_crop("thumb");
- $photo->square_crop("med");
- $photo->square_crop("large");
- $photo->new_size("thumb");
- $photo->new_size("med");
- $photo->new_size("large");
- @author jhackett hackjob83@gmail.com
- Last edit : 2015-05-20 */