简体   繁体   中英

How to use phpThumb() in zend framework

I am trying to use phpThumb() which i downloaded from http://phpthumb.sourceforge.net in zend framework I like it the way it generates thumbnails and resized images. Its simple to use. I just need to add an image tag to generate image as defined width and height:

<img src="phpThumb.php?src=image.jpg&w=100"/>

I would like to use it in zend framework. If anybody is using it in zend framework, could you please show me the way to use it. Currently I m planning to place the phpThumb() library inside public folder and calling it as

<img src="public/phpThumb.php?src=image.jpg&w=100"/>

Is this a good idea? I would also like to know how good is it? What are the security holes if any?

In my projects I place phpThumb in library/Vendor/PHPThumb and just use:

$file = 'PATH_TO_FILE';
$thumb = Vendors_PHPThumb_Thumb::create($file);
$thumb->resize($width, $height)->save($file);

this will resize source file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM