~ubuntu-fr/ubuntu-fr-website/www.dev

« back to all changes in this revision

Viewing changes to sites/all/modules/imageapi/imagerotate.inc

  • Committer: Vincent Liefooghe
  • Date: 2010-11-16 20:51:54 UTC
  • Revision ID: vl@ubuntovo-20101116205154-fuyfka524rm2zgni
Mise à jour des modules Backup & Migrate, Image API, Token et Pathauto

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php 
2
 
// $Id: imagerotate.inc,v 1.3.4.3 2009/03/18 08:35:59 drewish Exp $
 
1
<?php
 
2
// $Id: imagerotate.inc,v 1.3.4.5 2010/10/17 17:58:07 drewish Exp $
3
3
 
4
 
/** 
 
4
/**
5
5
 * @file
6
 
 * provides the imagerotate function for php-gd extensions compiled with the 
 
6
 * provides the imagerotate function for php-gd extensions compiled with the
7
7
 * upstream libgd instead of the libgd bundled with php.
8
8
 */
9
9
 
12
12
define('IMAGEAPI_IMAGEROTATE_PHP', 1);
13
13
 
14
14
function imagerotate(&$im, $angle, $bgcolor) {
15
 
  if ($angle === 0) { 
 
15
  if ($angle === 0) {
16
16
    return $im;
17
17
  }
18
18
  // imagerotate() in php's libgd rotates the image counterclockwise,
75
75
  imagesavealpha($rotate, TRUE);
76
76
 
77
77
  switch ($angle) {
78
 
    case 270:
 
78
    case 90:
79
79
      $rot_width--;
80
80
      for ($y = 0; $y < $height; ++$y)
81
81
        for ($x = 0; $x < $width; ++$x)
82
82
          imagesetpixel($rotate, $rot_width - $y, $x, imagecolorat($im, $x, $y));
83
83
      break;
84
 
    case 90:
 
84
    case 270:
85
85
      $rot_height--;
86
86
      for ($y = 0; $y < $height; ++$y)
87
87
        for ($x = 0; $x < $width; ++$x)