|
|
|
|
|
|
Posted: Thu Feb 17, 2005 7:55 pm
Well the problem with actions is that most of my images are unique and I don't apply the same filters too often sweatdrop . Although I guess I should make sure I know how to do them just in case.
What kind of server are we talking about here anyway?
|
|
|
|
|
|
|
|
|
|
|
Posted: Sat Feb 19, 2005 12:57 pm
GhoSt-X im looking for something more like a thumbnail resize upon upload ... a dynamically generating script that does it every time someone looks t a page would use too many server resources ... I have a book on PHP that may tell how to do this . . . It may take me a while to find and type up. sweatdrop
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Sat Feb 19, 2005 7:21 pm
haha ... i can probably figure it out... but any help is appreciated ..
|
|
|
|
|
|
|
|
|
|
|
Posted: Sun Feb 20, 2005 4:47 pm
I have made a thumbnail script before...I dunno if it helps or is what you are looking for, but it may help someone. Script # Constants define(IMAGE_BASE, 'http://www.phoenixrealm.com/fightnews/web') define(MAX_WIDTH, 150) define(MAX_HEIGHT, 250)
# Get image location $image_file = str_replace('..', '', $_SERVER['QUERY_STRING']) $image_path = IMAGE_BASE . "/$image_file";
# Load image $img = null; $ext = strtolower(end(explode('.', $image_path))) if ($ext == 'jpg' || $ext == 'jpeg') { $img = @imagecreatefromjpeg($image_path) } else if ($ext == 'png') { $img = @imagecreatefrompng($image_path) # Only if your version of GD includes GIF support } else if ($ext == 'gif') { $img = @imagecreatefrompng($image_path) }
# If an image was successfully loaded, test the image for size if ($img) {
# Get image size and scale ratio $width = imagesx($img) $height = imagesy($img) $scale = min(MAX_WIDTH/$width, MAX_HEIGHT/$height)
# If the image is larger than the max shrink it if ($scale < 1) { $new_width = 150;//floor($scale*$width) $new_height = 250;//floor($scale*$height)
# Create a new temporary image $tmp_img = imagecreatetruecolor($new_width, $new_height)
# Copy and resize old image into new image imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height) imagedestroy($img) $img = $tmp_img; } }
# Create error image if necessary if (!$img) { $img = imagecreate(MAX_WIDTH, MAX_HEIGHT) imagecolorallocate($img,0,0,0) $c = imagecolorallocate($img,70,70,70) imageline($img,0,0,MAX_WIDTH,MAX_HEIGHT,$c2) imageline($img,MAX_WIDTH,0,0,MAX_HEIGHT,$c2) }
# Display the image header("Content-type: image/jpeg") imagejpeg($img) ?>
How to use:
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Sun Feb 20, 2005 7:30 pm
haha .. thanks alot ill use your code as a reference ... thats just about what i want ... just need to apply it for what i wanna use it for ..
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue Feb 22, 2005 8:03 am
Okay, its the 22nd of Feb, I haven't been able to work much on the site, we have no site design, and we don't have writers for most of this months articles. This is a humungous task, and I doubt we will finish anything worth in the next 6 days.
Postpone this issue til next month? That will give us a bit more breathing space to do everything.
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue Feb 22, 2005 11:17 am
I can write an article... I can help with the design. I can help with the coding...
Lets try to shoot for this month and see what happens...if it does not come together, atleast we already have something for next month...
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue Feb 22, 2005 6:31 pm
I think that working on it for awhile longer is a good idea. We don't want to rush anything, and I think that with all the really smart people on here, we can come up with something really awesome. If we waited till next month, we could organize everyone that wants to help and it would get done better.
Do we want to have articles this month? We could put a note on the website that says we're putting together a really big issue for April, it will kinda make up for not having anything new for March.
After we get our website all put together and looking awesome, we can advertise all over and get lots of people to want to go there and look at it.
I know that I need more time to be able to work on the ideas that I have for the design.
So yes, I'm for waiting till April to launch our new stuff. 3nodding
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue Feb 22, 2005 8:25 pm
If you ever need some help with things you can PM, or IM me (info below). I'd be glad to help.
|
|
|
|
|
|
|
|
|
|
|
Posted: Wed Feb 23, 2005 12:21 pm
Here is something I whipped up in an afternoon. Maybe it could be of some use? I really just want to help. David
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Thu Feb 24, 2005 8:57 am
General LAyout not too bad ..someone could soup up the title bar though .. ^_^
|
|
|
|
|
|
|
|
|
|
|
Posted: Thu Feb 24, 2005 11:07 am
My big thing is the Kiss principle.
Yes, the header could use work, but everything else could be done through CSS, leaving very little load time.... biggrin
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Sat Feb 26, 2005 2:29 pm
GhoSt-X haha ... i can probably figure it out... but any help is appreciated .. All right . . . I think I found the script. Quote: $image = $HTTP_GET_VARS ['image']; if (!$max_width) $max_width = 80; if (!$max_height) $max_height = 60; $size = GetImageSize ($image); $width = $size [0]; $height = size [1]; $x_ratio = $max_width / $width; $y_ratio = $max_height / $height; if ( ($width <= $max_width) && ($height <= $max_height) ) { $tn_width = $width; $tn_height = $height; } else if ( ($x_ratio * $height) < $max_height) { $tn_height = ceil ($x_ratio * height); $tn_width = $max_width; } else { $tn_width = ceil ($y_ratio * $width); $tn_height = $max_height; } $src = ImageCreateFromJpeg ($image); $dst = ImageCreate ($tn_width, $tn_height); ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height); header ('Content - type: image/jpeg'); ImageJpeg ($dst, null, -1); ImageDestroy ($src); ImageDestroy ($dst); ?> I really have no clue how it works though. Sorry. sweatdrop Source: "PHP and MYSQL Developement" by Luke Welling and Laura Thomson
|
|
|
|
|
|
|
|
|
|
|
Posted: Sun Feb 27, 2005 8:12 am
|
|
|
|
|
|
|
|
|
Posted: Sun Feb 27, 2005 8:21 am
Kitsunehime - never trust what a book says...scripts usually don't work, and the ones that do are usually error ridden.
The script shown works a lot like the script I posted up a few posts... I tried the one you posted...broken... I was going to fix it and show you how to use it, but it really is more or less the same as my script above. And it is used the same way...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|