简体   繁体   中英

Php thumbnails on the fly

I have read several different threads regarding this but all of them deal with images that are already on the server.

I am storing images in a database (dont ask why :P) and what I am trying to do is generate the thumb as soon as I upload the pic and before I send it to the database.

I already have GD installed and have also installed timthumb.

Any ideas how this can be done? Or at least how should I go about it?

PHPThumb has been very easy to work with in my experience: http://phpthumb.gxdlabs.com/

About your particular problem: PHP holds the uploaded files temporarily, so you can create a thumbnail from them before the typical move_uploaded_file call. After that, call show(true) (this enables the raw data stream on PHPThumb) and store the returned value in your database.

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