Welcome Guest, Not a member yet? Register   Sign In
create more than 2 thumbnails using ci
#7

[eluser]Satlavida[/eluser]
[quote author="391" date="1272464489"]<?php
class Img extends Controller
{
public function __construct()
{
parent::Controller();
$this->load->library("image_lib");
$this->load->helper("form");
}
public function index()
{
$this->load->view('image',array('error'=>''));
}
public function do_upload()
{
$config['upload_path'] = './images/'; //cung cap voi system
$config['allowed_types'] = 'gif|jpg|png'; //the loai upload vao
$config['max_size'] = '2040';
$config['remove_spaces'] = true;
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload',$config);
if ( ! $this->upload->do_upload('image'))
{
$error = array('error' => $this->upload->display_errors());

$this->load->view("v_image", $error);
}
else
{
$image = array('upload_data' => $this->upload->data());
$thumbnail='./images/'."thumb_".$image['upload_data']['file_name'];

$featured='./images/'.'/featured/'."thumb_".'$image['upload_data']['file_name'];
$up['image_library'] = 'gd2';
$up['source_image'] = './images/'.$image['upload_data']['file_name'];
$up['create_thumb'] = TRUE;
$up['maintain_ratio'] = TRUE;
$up['width'] = 200;
$up['height'] = 121;
$this->image_lib->initialize($up);
$this->image_lib->resize();

//echo "Upload ok";
}
}
}
?>


//U can try it...[/quote]


Thanks...


Messages In This Thread
create more than 2 thumbnails using ci - by El Forum - 04-28-2010, 01:52 AM
create more than 2 thumbnails using ci - by El Forum - 04-28-2010, 01:56 AM
create more than 2 thumbnails using ci - by El Forum - 04-28-2010, 03:11 AM
create more than 2 thumbnails using ci - by El Forum - 04-28-2010, 03:21 AM
create more than 2 thumbnails using ci - by El Forum - 05-03-2010, 01:29 AM
create more than 2 thumbnails using ci - by El Forum - 05-06-2010, 03:08 AM
create more than 2 thumbnails using ci - by El Forum - 12-27-2010, 10:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB