Reputation: 3785
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?
Upvotes: 1
Views: 1359
Reputation: 3279
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.
Upvotes: 1