Welcome Guest, Not a member yet? Register   Sign In
thumb gererating problem
#1

[eluser]Bigil Michael[/eluser]
hi friends.
I have configured codeigniter 2.1.0 and uploaded image using upload library. my problem is in thumb generation
in ci 1.7.1 thumb marker is
Code:
$config1['thumb_marker'] = 'thumb_';
thumb image name will be thumb_imagename.jpg

in ci 2.1.0 thumb marker is
Code:
$config1['thumb_marker'] = 'thumb_';
now thumb image name like this imagename_thumb.jpg

it will make too difficult to display thumb image, because in my db image name is like this
imagename.jpg.

so i want to use this code

$config1['thumb_marker'] = 'thumb_';

can anyone help me???? where i have to change the code to generate thumb like 'thumb_imagename.jpg'.
thanks in advance....
#2

[eluser]marcogmonteiro[/eluser]
What I do is: I store the image name without the extension, then in another db field I store the extension. Then I can easily call the thumb since you have the image name and the image extension separated.
#3

[eluser]Bigil Michael[/eluser]
thanks for your help.

now i am searching the code how to change

_thumb to thumb_
#4

[eluser]Mauricio de Abreu Antunes[/eluser]
I'm curious: why do you need this format?
Its not secure save your images with their raw names.
Encrypt your names like md5(time().$imagename) or anything else.
When you upload your image (physic), save the image with the same name.
If the upload is ok, save this image in your database.
Other tip: use rezise for crate your thumbnail or use any helper to generate a dynamic output.

If you need some code, i can code it. Lemme know!

Smile
#5

[eluser]Bigil Michael[/eluser]
thanks for your help...
can u post the code??
#6

[eluser]Mauricio de Abreu Antunes[/eluser]
First,
read the guide: http://ellislab.com/codeigniter/user-gui...e_lib.html

After this, try out this (check syntax errors, please):
Code:
$config['image_library'] = gd2;
$config['source_image'] = $path.$file;
$config['new_image']     = $path.$newfile;
$config['width']        = 100;
$config['height']       = 100;

$this->image_lib->initialize($config);

if ( ! $this->image_lib->resize())
{
    echo $this->image_lib->display_errors();
} else {
    echo 'Image uploaded!';
}
#7

[eluser]marcogmonteiro[/eluser]
I made a thumb helper a while ago. You can check it out if you want.

https://github.com/mpmont/thumb_helper

#8

[eluser]Mauricio de Abreu Antunes[/eluser]
Nice helper, dude.
#9

[eluser]marcogmonteiro[/eluser]
Thanks mate! dunno if you're familiar with the spark system. I also have it has a spark.

http://getsparks.org/packages/thumb_help.../HEAD/show

(I also have a video helper but that is offtopic atm: http://getsparks.org/packages/video_help.../HEAD/show )




Theme © iAndrew 2016 - Forum software by © MyBB