Page 1 of 1

Compress picture retrieved from database

Posted: Thu Oct 20, 2005 5:37 pm
by mariusiik
Hy,

i was wondering if there is a way to compress a picture retrieved from a blob field in a database and show it (compressed) on a page.

I managed so far to display it as the original picture but I want to compress it.

One solution I found was using the "imagecopyresampled" function but that requires a resource from a file on the hdd.

Any ideas?

Best regards!

Posted: Thu Oct 20, 2005 6:04 pm
by feyd
imagecreatefromstring()

realtime resizing of images is very cpu intensive, I'd suggest storing the resized version somewhere.. I'd also suggest to not store images in the database unless you cannot store files on the server...