Welcome Guest, Not a member yet? Register   Sign In
How hard can it be?
#1

[eluser]frietkot[/eluser]
Hi,

I'm searching and trying this for a long time now but everything I try or read about just doesn't seem to work.

Here's the thing I want:
A form with 5 file browse buttons for searching some images (png, gif, jpg, etc..)
After submitting the form, each image would be uploaded (through the file uploading class) and then cropped and watermarked by the image manipulation class.

It seems simple, but there's no way I can get it working.
I would highly appreciate if someone could help me.

Thanks in advance,
Frietkot
#2

[eluser]umefarooq[/eluser]
Here i found some thing may be it will help you have look on it, it will explain you more.

http://codeigniter.com/wiki/Category:Ima...and_Cache/
#3

[eluser]frietkot[/eluser]
That could work, but the problem is that I want the files uploaded, resized and watermarked in one go.
I can get it easily done with one file per time, but that's not the thing I want.
I want to use it with 5 files per upload.
#4

[eluser]umefarooq[/eluser]
check this link this will also help you to put watermark on fly

http://www.sitepoint.com/article/watermark-images-php/

this link will also help you much to watermark you all uploaded images

http://wpglamour.com/how-to-watermark-al...ed-images/
#5

[eluser]majidmx[/eluser]
hi,
If you can do it for one file, what would be the problem which prevents you from doing it for 5 files ?
Just explain a little bit more, please.
#6

[eluser]ray73864[/eluser]
with php and html you can pass things as arrays, for instance:
Code:
Name 1: <input type="text" name="firstname[]" />
Name 2: <input type="text" name="firstname[]" />
etc...

you should be able to do a similar thing with the 'file' type, and then in your code you would do something like:
Code:
$firstname_array = $this->input->post('firstname');

foreach ($firstname_array as $firstname)
{
  echo $firstname . "<br />";
}
#7

[eluser]frietkot[/eluser]
Yeah I know, but the thing is, I want to use the upload and image librariesTongue
It should be simple I thought
#8

[eluser]xwero[/eluser]
I guess this is what you need.
Code:
$files = array(1,2,3,4,5) // you have to add actual input names of course
$this->load->library('upload');
// $up_config settings
$this->load->library('image_lib');
// $img_crop_config and $img_wm_config settings without source_image
foreach($files as $file)
{
   $this->upload->initialize($up_config);
   if($this->upload->do_upload($file))
   {
      $data = $this->upload->data();
      $img_crop_config['source_image'] = $img_wm_config['source_image'] = $data['full_path'];
      $this->image_lib->initialize($img_crop_config);
      $this->image_lib->crop();
      $this->image_lib->clear();
      $this->image_lib->initialize($img_wm_config);
      $this->image_lib->watermark();
      $this->image_lib->clear(); // clear image_lib settings for next loop
   }
}




Theme © iAndrew 2016 - Forum software by © MyBB