For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2006 > Re: image manipulation from mysql









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: image manipulation from mysql
neil davis

2006-03-29, 6:57 pm




On Mon, 27 Jun 2005 14:45:31 +0300, Parastatidis Nikos wrote:
[color=darkred]
> i have some customers images on blob fields
> i have an image template that i whan to use it as background and merge the
> customer image with the template
> this is what i mean manipulate gernaly handle the image directly as taken
> from the database and not storeing temporary on a file.
> is this posible?
> or do i have fopen and put the stream from the database on a temp file.
>
>
> "Parastatidis Nikos" <capamaru@quake.gr> wrote in message
> news:d9ommu$239$1@nic.grnet.gr...
Create a php file that:

starts a buffer
reads blob from db into buffer
sends a content-type header of the same type as image
flush buffer

then load image in your template like so:
<image src="myDbImage.php? someparameter=somevalueusedtopulltheimag
e"/>
there are examples of how to write an image stream out to the browser in
google.

This is the php file that you put in your image tag. Make sure you
get the content-type header correct. Don't let the browser figure this out
on it's own or you are asking for trouble. You can't do this inline in a
page, the image puller/generator needs to be it's own file because it
needs to send a content type header that's not text/html.

-Neil


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com