How to use thumb generator inside PHP script

前端 未结 4 516
一向
一向 2021-01-26 18:39

I\'m trying to use this thumbnail generator, but as you can see you have to go through this link to create an image thumb. This is maybe a dumb question, but how do I get it wor

4条回答
  •  有刺的猬
    2021-01-26 19:35

    I really can't see your problem...

    Do you want to do more than making a thumb at a line where you are calling the script? Just put out the lines of code from the thumb.php and use it in your script.

    include('image.class.php');
    
    $img = new Zubrag_image;
    
    // initialize
    $img->max_x        = $max_x;
    $img->max_y        = $max_y;
    $img->cut_x        = $cut_x;
    $img->cut_y        = $cut_y;
    $img->quality      = $image_quality;
    $img->save_to_file = $save_to_file;
    $img->image_type   = $image_type;
    
    // generate thumbnail
    $img->GenerateThumbFile($images_folder . $from_name, $thumbs_folder . $to_name);
    

    you only have to change the values with your desired one... this should work in my short review of the script.

提交回复
热议问题