如何在 PHP 脚本中使用拇指生成器 [英] How to use thumb generator inside PHP script

查看:31
本文介绍了如何在 PHP 脚本中使用拇指生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 this 缩略图生成器,但您可以看你要过此链接 以创建图像缩略图.这可能是一个愚蠢的问题,但是我如何让它在将一些变量保存到数据库的 php 脚本中工作?我试图包括

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 work inside a php script that saves some variables to database? I tried to include

header("Location: http://www.zubrag.com/thumb.php?src=http://www.test.com/test.jpg&dest=thumb.jpg&x=100&y=50"); 

但它不起作用.我敢打赌有很简单的解决方案,但我找不到.

but it doesn't work. I bet there's really easy solution but I can't find it.

推荐答案

我真的看不出你的问题...

I really can't see your problem...

除了在调用脚本的行上竖起大拇指外,您还想做更多事情吗?只需从 thumb.php 中取出几行代码并在您的脚本中使用它.

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.

这篇关于如何在 PHP 脚本中使用拇指生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆