January 22, 2018, 06:32:37 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
Author Topic: Neeeded help in Thumbnail Creator program .  (Read 9058 times)
Posts: 1

« on: November 24, 2007, 02:22:35 AM »

well i am new to this nice member of this site as well as i am new learner of php. i have dowloaded code from your site and just wana to get help from you ppl. well currently i hav another code that creating the thumbnail of a particular file easily when ever you upload it but the problem with this code the thumbnail lost its orignality or it does't create thumbs proportionally.

now i have try to run this code well this code is generating message again and again that

                               " Source file name must be specified "

my images floder path on the windows is C:\Apache2\htdocs\temp\images

and i have given path in the code is $images_folder = 'C:/Apache2/htdocs/temp/images ';

and path to thumb folder is $thumbs_folder = 'C:/Apache2/htdocs/temp/images' ;

and you have mentioned not to change the code below after a specific line but above mentioned eror is appearing agian and again.

there are many images in that folder say ,    234jur.jpg , abcji9.jpg , 200387(1).jpg ...etc.

now tell me how do i should call the function and where errors occur ??

GenerateThumbFile($images_folder . $from_name, $thumbs_folder. $to_name, $max_x, $max_y);

Hero Member
Posts: 785

« Reply #1 on: November 26, 2007, 05:34:37 AM »

Looks like you are not passing image file name to the script. Script needs to know which image needs thumbnail. It cannot convert all images in the folder (yet, i think i'll add this feature). Note: i just uploaded updated thumbnail generator.

It depends on how you want to generate thumbnail. Thumbnail can be generated from browser (passing all parameters via url) or from your existing php script (setting parameters in the script).

Note: description says for images and thumbs folders - "MUST end with slash". You did not put slash at the end. Also you put space at the end, which will cause problems.

Via URL:
It will search for image.jpg in the $images_filder (you set it in the thumb.php) and will create thumbnail thumbname.jpg in the $thumbs_folder (you set it in the thumb.php)

If you want to create thumbs from your program then add following code to your program

// include image processing code

$img = new Zubrag_image;

// initialize
$img->max_x        = max_thumb_width; // ex 100
$img->max_y        = max_thumb_height; // ex 100
$img->cut_x        = cut_width_before_creating_thumb; // ex 800, set to 0 to skip
$img->cut_y        = cut_height_before_creating_thumb; // ex 600, set to 0 to skip
$img->quality      = image_quality; // 0 to 100, 0 - bad, 100 best
$img->save_to_file = $save_to_file; // 1 - save to file, 0 - output in browser
$img->image_type   = $image_type; // -1 - use default, 1 = save as GIF, 2 = JPG, 3 = PNG

// generate thumbnail
$img->GenerateThumbFile(path_to_source_image, thumbnail_path);
Posts: 3

« Reply #2 on: May 20, 2013, 08:36:32 PM »

It looks great.I'll try the codes you guys offered.and meanwhile I just need more complete codes or library to create thumbnail generator.and I found thumbnais generating guide by google, can you tell me if it is working?

thx in advance
Pages: [1]
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC