|
Posted by Stefan Rybacki on 06/27/05 19:16
nemo wrote:
> On Mon, 27 Jun 2005 18:08:19 +0300, "Parastatidis Nikos" <capamaru@quake.gr>
> wrote:
>
> >imagecreatefromstring()
> >this is what i whanted and my eye didnt catch it from the manual
> >thanks alot stefan.
> >
> >
> >"Stefan Rybacki" <stefan.rybacki@gmx.net> wrote in message
> >news:3iaifeFkiju0U1@individual.net...
> >> nemo wrote:
> >>> On Mon, 27 Jun 2005 14:45:31 +0300, "Parastatidis Nikos"
> >>> <capamaru@quake.gr>
> >>> wrote:
> >>>
> >>> >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.
> >>> Are you wanting to go something like - <img src="$Row[image]">
> >>> as opposed to
> >>> <img src="image_directory/$Row[image_filename]">?
> >>> What have you tried?
> >>> I repeat - it's best to store only the filename.
> >>
> >> I guess I wants more like this:
> >>
> >> $img1=createFromStream($row['img1']);
> >> $img2=createFromStream($row['img2']);
> >>
> >> $newimg=mergeImages($img1,$img1);
> >>
> >> and then for example store it
> >>
> >> imageJpeg($newimg,'filename.jpg');
> >> print('<img src="filename.jpg">');
> >>
> >>
> >> but I think he is wants to do something more like this:
> >>
> >> header("image/jpeg");
> >> imageJpeg($newimg);
> >>
> >> HTML - File somewhere
> >>
> >> ...
> >> <img src="mergedImages.php?image1=7&image2=9">
> >>
> >>
> >>
> >> The OP should help to know what he wants.
> >>
> >> Regards
> >> Stefan
> >
> php.net says -
> QUOTE
> resource imagecreate ( int x_size, int y_size )
>
> imagecreate() returns an image identifier representing a blank image of size
> x_size by y_size.
> UNQUOTE
> So that means (I think!) that he's creating a blank image of a certain size
> which he then fills with the contents of a blob from his database.
>
> As this seems to me to be duplication, what advantage (if any) does his that
> have over "my" preference, or under what circumstancesd should I choose it?
Its correct, you should not store the images data into the database but
a reference to the images location on the server. So you are right with
your suggestion to store the image outside the database.
But the OP is right to load the image via imagecreatefromstring or
imagecreatefromjpeg, whatever, if he wants to merge two pictures together.
Regards
Stefan
[Back to original message]
|