Subdomain Posts
None | 22 min ago
None | 23 min ago
None | 1 hour ago
None | 3 hours ago
None | 6 hours ago
None | 6 hours ago
None | 7 hours ago
None | 10 hours ago
None | 13 hours ago
None | 19 hours ago
Recent Posts
JavaScript | 3 sec ago
XML | 1 min ago
CSS | 2 min ago
None | 2 min ago
None | 2 min ago
None | 2 min ago
REBOL | 3 min ago
None | 3 min ago
PHP | 4 min ago
None | 4 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Minus Creative on the 21st of Jul 2008 02:34:56 AM
Download |
Raw |
Embed |
Report
/*
* A simple implementation for an 'EXIF' auto-rotate
* option in Image lib. Uses PHP's built-in EXIF
* reading capabilities. 'IFDO' is a small subset
* of the available EXIF data. It might be
* preferred to read all EXIF data instead, and
* then pass that information back to the user
* since it's already being read. Maybe they
* should be separated, and EXIF should be
* automagically called if 'EXIF' is passed
* to rotate.
*
* This is really simple and lacks basic checks, I know.
*/
/*
* Read the EXIF
*/
/*
* Auto-rotate based on provided EXIF
*/
switch($image->exif['Orientation']) {
case 1:
break;
case 2:
$image->flip(5);
break;
case 3:
$image->rotate(180);
break;
case 4:
$image->flip(6);
break;
case 5:
$image->rotate(90)->flip(6);
break;
case 6:
$image->rotate(90);
break;
case 7:
$image->rotate(90)->flip(5);
break;
case 8:
$image->rotate(-90);
break;
}
Submit a correction or amendment below.
Make A New Post