Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 3365E9FBBAD for ; Wed, 13 Jun 2007 17:58:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 93453-03 for ; Wed, 13 Jun 2007 17:58:14 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by postgresql.org (Postfix) with ESMTP id F08769FBB19 for ; Wed, 13 Jun 2007 17:58:23 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c36so69757ana for ; Wed, 13 Jun 2007 13:58:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=X8Q0PyFnK6SUk8IRx5bQheqK9nsyHDe6pLVQsU6F5Q1rvWXlOUvfecwrCc0N5Au2nmV99OjTYhQT54wfUbEEYCg0zCNcImyLmJ4DLyKVr+alwp6NIGu19+mcSbU2/imff8Xj9cw6zLWR6EFYk35yqVPe3wZKAn66N0FUG5Fo1Ec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=e7EUhApOljQv3emqEw4/sHOHpulUpHNbt0yRcT9nGKW72XHZBvmxJ1jHfy983g58fgUvUItTBlKUoJHepkFyfmxxJa9IpoAXoBYkCURvPDGFxucRbLOKWVVubv5cwGyixDb0FPEjjHnRTrn2Rf7HLWdXIpSrGsWSZ/3F5Ubngbs= Received: by 10.100.215.11 with SMTP id n11mr619117ang.1181768302228; Wed, 13 Jun 2007 13:58:22 -0700 (PDT) Received: by 10.100.110.1 with HTTP; Wed, 13 Jun 2007 13:58:22 -0700 (PDT) Message-ID: Date: Wed, 13 Jun 2007 13:58:22 -0700 From: "Colin Ross" To: pgsql-php@postgresql.org Subject: Re: php, postgresql and graphical images In-Reply-To: <4670561B.8020301@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_39658_2064345.1181768302067" References: <20070613115155.uykzmxtvxueoo4w8@imp3.uta.fi> <466FB441.6000204@postgresql.org> <20070613230611.mewiitg4mnco8kwo@imp3.uta.fi> <4670561B.8020301@postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/8 X-Sequence-Number: 3810 ------=_Part_39658_2064345.1181768302067 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Using that, you could just point the src atribute of an img tag to that url, OR present the data inline using the object tag (but that gets tricky fyi and cane be kinda slow for all but the most trivial of images [hence why its highly discouraged by the w3c] A Necklace Again, I **highly** recommend the first method Colin http://www.w3.org/TR/html401/struct/objects.html#h-13.2 On 6/13/07, Dave Page wrote: > > Mihail Mihailov wrote: > > Hi Dave and thanks for advice. > > > > You show in your example how to create an html file containing only one > > picture. > > How do you insert multiple graphical images into a "mixed" document > > containing text and graphical images? > > Do I still have to save bytea data into a temporary file (how?) and than > > get in with tag? > > No, I showed how to return an image in response to a http request using > php, e.g: > http://www.jo-jos-jewellery.co.uk/system/showimage.php?id=85495. No HTML > or text was served at al. That URL (or variations thereof) can be used > directly in an tag as many times as you want in a single HTML > document. > > Regards, Dave. > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > ------=_Part_39658_2064345.1181768302067 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Using that, you could just point the src atribute of an img tag to that url,

<img src="http://www.jo-jos-jewellery.co.uk/system/showimage.php?id= <?php echo $imgId ?>" />

OR present the data inline using the object tag (but that gets tricky fyi and cane be kinda slow for all but the most trivial of images [hence why its highly discouraged by the w3c]

<OBJECT id="necklace"
...
data="data:image/jpeg;base64, ...base64 data...">
A Necklace
</OBJECT>

Again, I **highly** recommend the first method

Colin




http://www.w3.org/TR/html401/struct/objects.html#h-13.2


On 6/13/07, Dave Page <dpage@postgresql.org> wrote:
Mihail Mihailov wrote:
> Hi Dave and thanks for advice.
>
> You show in your example how to create an html file containing only one
> picture.
> How do you insert multiple graphical images into a "mixed" document
> containing text and graphical images?
> Do I still have to save bytea data into a temporary file (how?) and than
> get in with <img> tag?

No, I showed how to return an image in response to a http request using
php, e.g:
http://www.jo-jos-jewellery.co.uk/system/showimage.php?id=85495. No HTML
or text was served at al. That URL (or variations thereof) can be used
directly in an <img> tag as many times as you want in a single HTML
document.

Regards, Dave.


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

------=_Part_39658_2064345.1181768302067--