English 中文(简体)
恢复和轮流形象——密码
原标题:Resize and rotate image - Codeigniter

I m trying to resize and rotate a image.

At the moment it s only resizing the image, but not rotate it.

这里是法典,希望有人能找到解决办法,或者说:

$config[ image_library ]   =  gd2 ;
$config[ source_image ]    = $data[ full_path ];
$config[ new_image ]       = $data[ file_path ]. thumbs/ .$data[ file_name ];
$config[ create_thumb ]    = FALSE;
$config[ maintain_ratio ]  = TRUE;
$config[ width ]           = 235;
$config[ height ]          = 235;

$this->load->library( image_lib , $config); 

$this->image_lib->resize();

$this->image_lib->clear();

$config[ create_thumb ] = FALSE; //No thumbnail
$config[ source_image ] = $data[ file_path ]. thumbs/ .$data[ file_name ]; //full path for the source image
$config[ rotation_angle ] =  180 ;// 

$this->load->library( image_lib ,$config);

//Rotate the image
$this->image_lib->rotate();
最佳回答

之后

$this->image_lib->clear()。

增加:

<代码>config = 阵列()以重新启用其组合阵列。

问题回答

在清理该组合后,不重载图书馆,重新启用:

$this->image_lib->clear();
$config=array();
$config[ image_library ]   =  gd2 ;
$config[ source_image ] = $data[ file_path ]. thumbs/ .$data[ file_name ];
$config[ rotation_angle ] =  180 ;
$this->image_lib->initialize($config); // reinitialize it instead of reloading
$this->image_lib->rotate();

这是最终为我工作的唯一解决办法。 《国际公认准则》第2.2.0条没有列出刚开购的款项。

确保在寄回之前收回这笔钱。

否则,你可能最终放弃你不想寄出的价值观。

此时轮值如下:

$config[ image_library ]   =  gd2 ;
$config[ new_image ]       = $data[ file_path ]. thumbs/ .$data[ file_name ];
$config[ maintain_ratio ]  = TRUE;
$config[ width ]           = 235;
$config[ height ]          = 235;
$config[ create_thumb ] = FALSE; //No thumbnail
$config[ source_image ] = $data[ file_path ]. thumbs/ .$data[ file_name ]; //full path for the source image
$config[ rotation_angle ] =  180 ; //




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签