我已经在codeigniter中创建了一个库。它不起作用。
我的库文件是;
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Image_pixelete{
function __construct()
{
$this->ci=&get_instance();
}
public function do_pixel()
{
$image = imagecreatefromjpeg(base_url().'photo/Penguins.jpg');
$imagex = imagesx($image);
$imagey = imagesy($image);
$pixelate_y=10;
$pixelate_x=10;
$height=$imagey;
$width=$imagex;
for($y = 0;$y < $height;$y += $pixelate_y+1)
{
for($x = 0;$x < $width;$x += $pixelate_x+1)
{
// get the color for current pixel
$rgb = imagecolorsforindex($image, imagecolorat($image, $x, $y));
// get the closest color from palette
$color = imagecolorclosest($image, $rgb['red'], $rgb['green'], $rgb['blue']);
imagefilledrectangle($image, $x, $y, $x+$pixelate_x, $y+$pixelate_y, $color);
}
}
}下面是我的控制器调用
public function pixel()
{
$this->load->library('Image_pixelete');
$this->Image_pixelete->do_pixel();
}这就是我的错误;

我对解决这个问题的确切性质感到困惑。你能帮我复习一下吗?
发布于 2013-03-24 11:47:29
尝试加载并使用小写的库。
$this->load->library('image_pixelete');
$this->image_pixelete->do_pixel();https://stackoverflow.com/questions/15594824
复制相似问题