/extremedating/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/extremedating/trunk

« back to all changes in this revision

Viewing changes to get_image.php

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-15 17:15:56 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130415171556-q5zcc5mdle93vm1q
code cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
  if(count($fetch) > 0 && $fetch[0]['profileImage'] != "" ) {
201
201
    $image = new Imagick();
202
202
    $image->readImageBlob(base64_decode($fetch[0]['profileImage']));
203
 
    $imageprops = $image->getImageGeometry();
204
 
    /*var_dump($imageprops);
205
 
    if ($imageprops['height'] > 280 || $imageprops['width'] > 280){
206
 
      $image->resizeImage(280,280);
207
 
    } else if ($imageprops['height'] < 280 || $imageprops['width'] < 280) {
208
 
      if ($imageprops['height'] = $imageprops['width'] ) {
209
 
        $image->resizeImage(280,280, imagick::FILTER_LANCZOS, 0, false);
210
 
      } else if ($imageprops['height'] > $imageprops['width'] ){
211
 
        $image->resizeImage(280,0, imagick::FILTER_LANCZOS, 0, false);
212
 
      } else if ($imageprops['height'] < $imageprops['width'] ){
213
 
        $image->resizeImage(0, 280, imagick::FILTER_LANCZOS, 0, false);
214
 
      }
215
 
      $image->cropImage(280,280,0,0);
216
 
    }
217
 
    */
 
203
    //var_dump($imageprops);
218
204
    //var_dump($image);
219
205
    $img = stupid_rescale_and_crop($image, 280, 280);
220
206
    $img->setImageFormat("png");