well, my script works ok for what i want.
basically - with GD I can't control the quality - so I use Photoshop to make them thumbs and I use compressed .jpeg for the bigger ones (excuse some discrepencies!) also using Photoshop.
For the DB i just store the path of the thumbs and the bigger pics - waaaaaaaaayyy more efficient in DB terms than using BLOB in the DB if that is what you're doing.
Hope this helps.
Rupert