Welcome Guest, Not a member yet? Register   Sign In
Imgli rotate error
#1

[eluser]iniweb[/eluser]
In example (Codeignier doc):

Code:
$config['image_library'] = 'GD2';
$config['source_image'] = str_replace('/'.$_SERVER['DOCUMENT_ROOT'], '', $data['full_path']);
$config['rotation_angle'] = '90';

$this->image_lib->initialize($config);

Error: An angle of rotation is required to rotate the image

if i'am using rotate hor or vrt normal, but if i'am put 90,180,270 display error.
#2

[eluser]gtech[/eluser]
I had a quick look at the image_lib.php file in the libraries directory

on line 392 you see the following code

Code:
..
  function rotate()
  {
    // Allowed rotation values
    $degs = array(90, 180, 270, 'vrt', 'hor');    
    ..

looks like you need to set the rotation angle as an integer:
Code:
$config['image_library'] = 'GD2';
$config['source_image'] = str_replace('/'.$_SERVER['DOCUMENT_ROOT'], '', $data['full_path']);
//$config['rotation_angle'] = '90';
$config['rotation_angle'] = 90;

let me know how you get on! Smile, if it works then the documentation is wrong/
#3

[eluser]bradmkjr[/eluser]
Greeting CI forum members,

I came across this post, and still having the same issue documented here. After a ton of research I discovered that the Debian server I'm using doesn't have the newest most full install of GD, even though it has php 5.

So if you are trying to run image rotate (90, 180, 270) and having issues try this command on your server:

Code:
print_r(get_defined_functions());

scan though the output for 'imagerotate' if it isn't there you will need to use another image library or define your own imagerotate function. There are a variety to choose from on http://php.net/imagerotate, but non are as quick and simple as the GD2 library imagerotate.

Hope this helps someone,
Brad
http://x86virtualization.com




Theme © iAndrew 2016 - Forum software by © MyBB