you *could* limit them, imaesx() and imagesy() are what your looking for. what I would
say is why? why limit someones image upload when you can easily resize it.
display_thumbnail.inc
<?php
include_once('database.egn');
include_once('time.egn');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if ( $prod_r = fetch_db_value('product_image', "WHERE product_id = '$product_id' ") )
{
if ($prod_r['product_image'] AND ereg('jpeg', $prod_r['product_image_type']) )
{
$src_img = imagecreatefromstring($prod_r['product_image']);
if (!isset($new_h))
$new_h = 100;
$new_w = $new_h * ( imagesx($src_img) / imagesy($src_img) );
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
Header("Content-Type: {$prod_r['product_image_type']}");
imagejpeg($dst_img, '', 100);
unlink($fname);
exit();
}
}
Header('Content-Type: image/gif');
readfile("$DOCUMENT_ROOT/image/nopic.gif");
?>
should be able to hack it up :)
--
Chris Lee
[EMAIL PROTECTED]
""george"" <[EMAIL PROTECTED]> wrote in message
99a9eu$fek$[EMAIL PROTECTED]">news:99a9eu$fek$[EMAIL PROTECTED]...
I want to restrict the height and width of a file a user will upload to the
how do I do this, is there a function for this.
TIA
--
george
[EMAIL PROTECTED]
remove my_pants to reply
P@tty's excellent DW tutorial site
http://www.thepattysite.com/dreamweaver/
Jhinuk Chowdhury 's DW FAQ
http://people.unt.edu/~jhinuk/DW_FAQ.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]