On Tue, May 1, 2007 5:54 am, Alain Roger wrote:
>> else // both $width and $height are smaller than max, so we need to
>> zoom

Zooming an image is RARELY satisfactory in appearance...

I'd say just leave it alone, personally.

>> $escaped = pg_escape_bytea($thumb); // does not work and it's normal
>
> $thumb is an image, so ho can i make it useful for pg_escape_bytea
> function
> ?

$thumb isn't the actual JPEG image.

It's just a PHP resource number, pointing to the image.

So, essentially, you are cramming the number "3" (or "2" or "4" or
whatever) into PostgreSQL.

You would need to do something not unlike:

ob_start();
imagejpeg($thumb);
$image = ob_get_contents();
ob_end_clean();
$escaped = pg_escape_bytea($image);

//Insert obligatory "don't store images in DB flame-war here" :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to