faster way to display jpg-blobs?
От | Knut Suebert |
---|---|
Тема | faster way to display jpg-blobs? |
Дата | |
Msg-id | 20010318062235.A20520@cascal.vtb обсуждение исходный текст |
Ответы |
Re: faster way to display jpg-blobs?
|
Список | pgsql-php |
Hello, I'm new to this list. And I have the following question: is there a better/faster way than the following to read jpeg-blobs out of the database and display them? if( $db->next_record() ){ header("Content-Type: image/jpeg"); $bild = $db->lo_read($db->f("oid")); header("Content-Length: 1024000"); // has to be calculated print($bild); } where lo_read() is function lo_read($oid, $mode="r"){ $this->connect(); pg_exec($this->Link_ID, "begin"); // a must for blob-operations if( $lo_id = pg_loopen( $this->Link_ID, $oid, $mode ) ){ $lo = pg_loread( $lo_id, 1024000 ); // has to be calculated pg_loclose($lo_id); } pg_exec($this->Link_ID, "end"); return $lo; // empty leer, wenn auslesen gescheitert } Because of the begin/end every picture on a page is loaded one after the other, I fear. Not simultaneous as if there would be a direct <img src='pic_N.jpg'> instead of <img src='pic.php?id=N'>. Using blobs is a must IMHO, as viewing the pics should only be possible for authorized people. Thanks, bye, Knut
В списке pgsql-php по дате отправления: