Subject AW: AW: [firebird-php] Show a Jpg stored as Binary blob in a firebird table with PHP
Author Gerhard Knapp
thank you very much Almond ...

the first time is see the images!!! :)

but now another problem exists: the images have errors,
wrong colors and so on ..., the resulting xxxx.jpg files
have this errors..., the images in the db are ok, i tested it
with IBExpert and delphi-application.
the size image.width and image.height is the right one, so i think the
is correct, but the data not ...
(my jpgs have the size: 512 x 384 pixel)

best regards

-----Ursprungliche Nachricht-----
Von: Almond [mailto:almond@...]
Gesendet: Donnerstag, 26. Juni 2003 07:09
Betreff: Re: AW: [firebird-php] Show a Jpg stored as Binary blob in a
firebird table with PHP

The following is the combination of other people's work. It works on my

$db = '/data/html/phpgem312/test.gdb';
$user = 'sysdba';
$password = 'masterkey';

$S = "select images_id, image from images_tbl";
$S .= " where images_id > '0'";

$Q = ibase_query($S);
while ($R = ibase_fetch_object($Q))
$TEMPFILE = tempnam("./","TMP");
$TEMPFILE .= ".jpg";

$BLOBID = ibase_blob_open($R->IMAGE);
$FILEID = fopen($TEMPFILE,"w");

//Loop thru the blob, fetching 10K chunks, and write it to the temp file
while ($PIC = ibase_blob_get($BLOBID,10240))

At 16:54 03/06/25 +0200, you wrote:
> >$sst = "SELECT image, image_type FROM images_tbl WHERE images_id='123''
> >$result = ibase_query($sst, $f);
> >if(empty($result)) echo SQL_error($f,$sst)."<BR>";
> >$tmprow=SQL_fetch_object($result,0);
>you mean ibase_fetch_object ??
Sorry, I use a sql lib.

> >$image = $tmprow->image;
> >header("Content-type: ".$tmprow->image_type);
>i have no imagetype stored in db, what is the value for image_type? "JPG"

image/jpeg, it looks like IE6 can echo the picture w/o it.

> >headers_sent();
>here comes the error, headers was sent before, sorry -..

The above method is used by calling an external php, so, there is always a
"<IMG SRC=\"image.php?id=999\">

>id doesn't work ...
>have an working example???
>thank you
>best regards

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.