为什么我调整大小的图像大小不是我想要的和期望的?

时间:2017-06-08 17:48:33

标签: php codeigniter-3

我希望图像宽度和高度250,同时图像调整为250X150?但为什么? 这是我的控制器代码

android:canPerformGestures="true"

1 个答案:

答案 0 :(得分:0)

感谢 Adrianopolis ,它有效。 我已更改此代码

$config =  array(
      'image_library'   => 'gd2',
      'source_image'    =>  $data['full_path'],
      'maintain_ratio'  =>  TRUE,
      'width'           =>  250,
      'height'          =>  250,
    );
    $this->image_lib->clear();
    $this->image_lib->initialize($config);
    $this->image_lib->resize();

Into

$config =  array(
      'image_library'   => 'gd2',
      'source_image'    =>  $data['full_path'],
      'maintain_ratio'  =>  FALSE,
      'width'           =>  250,
      'height'          =>  250,
    );
    $this->image_lib->clear();
    $this->image_lib->initialize($config);
    $this->image_lib->resize();