Resize Of Avatar In Lavalair Script

Started on the old forum in August 2007 · view the original in the archive · old links redirect here

29 replies · 2,449 views · started 19 years ago · 1 min read

TL;DR · summary of 29 replies
  • - The code provided in the thread was to resize images on the fly, but it did not specify where to place the code within a PHP script.
  • - A user named Guest asked how to implement this resizing functionality in their own script.
  • - Another user suggested placing the code inside the PHP script where image handling functions are called, such as after calling getavatar($who) for avatar images.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

8 participants
alesh Lead · 604 posts #2

resize the pic b4 u upload it...... dnt b so lazy

eeeeerrr....

alexism Developer · 136 posts #3

lol..but not all user have pic resizer u lmoa...give the coding plz..

metulj Super moderator Principal · 1,726 posts #4

lol..but not all user have pic resizer u lmoa...give the coding plz..

give give .... give GIVE GIVE....

hmm....

HOW ABOUT YOU SEARCH BEFORE YOU ASK?

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

modfiles Developer · 200 posts #5

QUOTE (metulj @ Mar 9 2008, 07:15 PM) <{POST_SNAPBACK}>

give give .... give GIVE GIVE....

hmm....

HOW ABOUT YOU SEARCH BEFORE YOU ASK?

For those who are lazy to search. lol

<?php
    //[img]thumbit.php?image=http://www.mysite.com/images/myphoto.jpg[/img]
    // Input
    $s_image = $_GET['image']; // Image url set in the URL. ex: thumbit.php?image=URL
    $e_image = "error.jpg"; // If there is a problem using the file extension then load an error JPG.
    $max_width = 30; // Max thumbnail width.
    $max_height = 30; // Max thumbnail height.
       $quality = 80; // Do not change this if you plan on using PNG images.

    // Resizing and Output : Do not edit below this line unless you know what your doing.

    if (preg_match("/.jpg/i", "$s_image"))  {

    header('Content-type: image/jpeg');
      list($width, $height) = getimagesize($s_image);
    $ratio = ($width > $height) ? $max_width/$width : $max_height/$height; 
    if($width > $max_width || $height > $max_height) { 
    $new_width = $width * $ratio; 
    $new_height = $height * $ratio; 
    } else {
    $new_width = $width; 
    $new_height = $height;
    } 
      $image_p = imagecreatetruecolor($new_width, $new_height);
    $image = imagecreatefromjpeg($s_image); 
    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    imagejpeg($image_p, null, $quality); 
    imagedestroy($image_p); 

    }
       elseif (preg_match("/.png/i", "$s_image"))  {

    header('Content-type: image/png');
      list($width, $height) = getimagesize($s_image);
    $ratio = ($width > $height) ? $max_width/$width : $max_height/$height; 
    if($width > $max_width || $height > $max_height) { 
    $new_width = $width * $ratio; 
    $new_height = $height * $ratio; 
    } else {
    $new_width = $width; 
    $new_height = $height;
    } 
    $image_p = imagecreatetruecolor($new_width, $new_height);
    $image = imagecreatefrompng($s_image); 
    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    imagepng($image_p, null, $quality); 
    imagedestroy($image_p); 

    }
       elseif (preg_match("/.gif/i", "$s_image"))  {

    header('Content-type: image/gif');
      list($width, $height) = getimagesize($s_image);
    $ratio = ($width > $height) ? $max_width/$width : $max_height/$height; 
    if($width > $max_width || $height > $max_height) { 
    $new_width = $width * $ratio; 
    $new_height = $height * $ratio; 
    } else {
    $new_width = $width; 
    $new_height = $height;
    } 
    $image_p = imagecreatetruecolor($new_width, $new_height);
    $image = imagecreatefromgif($s_image); 
    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    imagegif($image_p, null, $quality);
    imagedestroy($image_p); 

    }
       else {

    // Show the error JPG.
    header('Content-type: image/jpeg');
    imagejpeg($e_image, null, $quality); 
    imagedestroy($e_image); 

    }    

?>
metulj Super moderator Principal · 1,726 posts #8

will you let me put that code in your script? just give me your password and username. but if you wont, do it yourself. External image (may be gone) code is provided to you already, all you have to do is to know where you will put it. lol. and you laso have an idea where to put it coz you wont ask for it you dont know. External image (may be gone)

why the f**k you need his username and password??? when you could explain him here where to put that code! External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

metulj Super moderator Principal · 1,726 posts #10

External image (may be gone) to force him to do,think and analyze of its own. so the next time, if he saw a code and want it that badly, he wont rely or ask a question which think is to easy to solve. External image (may be gone)

well... let's take for example me and you... whats very easy for me.. can be very hard for you and ofcourse vice versa... ppl are different you know... some need help about php.. others can write php faster than you can think some need help with driving car... others can drive so fast that they become F1 world champion... you get the picture? External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

alexism Developer · 136 posts #11

both of u r muthafucking lmoa...jus tell me where must i put that code u muthafaka..

metulj Super moderator Principal · 1,726 posts #12

both of u r muthafucking lmoa...jus tell me where must i put that code u muthafaka..

with such attitude you can only go FUCK YOURSELF ! muppet

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

modfiles Developer · 200 posts #13

[qoute=with such attitude you can only go FUCK YOURSELF ! muppet][/qoute] read what that leecher post? lol.. hes asking where to put the code without analyzing and trying it and that f**kin leecher has the face to post that.

both of u r muthafucking lmoa...jus tell me where must i put that code u muthafaka..

you wont get any help da*n leecher if your like that. go and ask your mama now for a help.

alexism Developer · 136 posts #14

thats right metulji bro..evrybody r diffrent...so can u tell me where must i ut that code?

metulj Super moderator Principal · 1,726 posts #15

both of u r muthafucking lmoa...jus tell me where must i put that code u muthafaka..

Hmmmmm....

thats right metulji bro..evrybody r diffrent...so can u tell me where must i ut that code?

..and now im your bro..?? get a life External image (may be gone) External image (may be gone) External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

alexism Developer · 136 posts #16

lol..lets by gone be by gone bro...where must i put that code metulji bro?

metulj Super moderator Principal · 1,726 posts #18

External image (may be gone) anybody?? External image (may be gone)

go learn PHP...... and attitude!

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close