IMagick confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This code (invoked by an IMG tag on a page) will return the image which is
then displayed:
----------------------------------------------------------------------------
----------------
<?php
 $picture = $_GET['PICTURE'];
 /* need to get filetype from querystring "picture=" */
 header('Content-type: image/jpg');
 $image = new IMagick($picture);
 echo $image;
?>
----------------------------------------------------------------------------
----------------
 ... but this code does not (even when the value of $orientation is 1):
----------------------------------------------------------------------------
----------------
<?php
 $picture = $_GET['PICTURE'];
 /* need to get filetype from querystring "picture=" */
 header('Content-type: image/jpg');
 $image = new IMagick($picture);
 $orientation = $image->getImageProperty("exif:Orientation")
 switch($orientation)
  {
  case 1:     /* normal */
   break;
  case 2:     /* mirror */
   break;
  case 3:     /* 180 anti-clockwise */
   break;
  case 4:     /* mirror + 180 anti-clockwise */
   break;
  case 5:     /* mirror + 90 anti-clockwise */
   break;
  case 6:     /* 90 anti-clockwise */
   break;
  case 7:     /* mirror + 270 anti-clockwise */
   break;
  case 8:     /* 270 anti-clockwise */
   $image->rotateImage(new ImagickPixel(), 90);
   break;
  case default:
   break;
  }
 echo $image;
?>
----------------------------------------------------------------------------
----------------
I'm confused.  Can someone please shed light on what's happening?

Thanks,
Stan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux