rotate an image

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

 



Not replace images. R o t a t e... like 15 degrees clockwise???
I chacked the manual and what is suggested doesn't seem to want to work.
I have GD enabled, but all I get is a garbled output on the page.
Her's what was offered:
|<?php
// File and rotation
$filename = 'test.jpg';
$degrees = 180;
// Content type
header('Content-type: image/jpeg'); This has to be in the header!!!! (MY
comment)
// Load
$source = imagecreatefromjpeg($filename);
// Rotate
$rotate = imagerotate($source, $degrees, 0);
// Output
imagejpeg($rotate);
?> |
I want to display an image rotated (canted, if you prefer) to the right
or left next to text.
There's not much (or too much) info on how to do this.
Obviously, I can resize, rotate and create a png file with transparent
bg... but why go through all that hassle?
Any ideas, anyone?

-- 
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- pj@xxxxxxxxxxxxx
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


-- 
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