| 1: |
<? |
| 2: |
if ( isset($_GET['URL'])){ |
| 3: |
$URL=$_GET['URL']; |
| 4: |
}else{ |
| 5: |
$URL=""; |
| 6: |
} |
| 7: |
if ( isset($_GET['SIZE'])){ |
| 8: |
$SIZE=$_GET['SIZE']; |
| 9: |
}else{ |
| 10: |
$SIZE=""; |
| 11: |
} |
| 12: |
|
| 13: |
if ( isset($_GET['OUT'])){ |
| 14: |
$OUT=$_GET['OUT']; |
| 15: |
}else{ |
| 16: |
$OUT=""; |
| 17: |
} |
| 18: |
if ( $_GET[MASK] == 1) |
| 19: |
{ |
| 20: |
$MASK='WRoll.jpg'; |
| 21: |
} |
| 22: |
if ( $_GET[MASK] == 2) |
| 23: |
{ |
| 24: |
$MASK='Wsquare.gif'; |
| 25: |
} |
| 26: |
if ( $_GET[MASK] == 3) |
| 27: |
{ |
| 28: |
$MASK='WCorner.gif'; |
| 29: |
} |
| 30: |
if ( $_GET[MASK] == 4) |
| 31: |
{ |
| 32: |
$MASK='Wdiagonal.gif'; |
| 33: |
} |
| 34: |
if ( $_GET[MASK] == 5) |
| 35: |
{ |
| 36: |
$MASK='Wslats.gif'; |
| 37: |
} |
| 38: |
if ( $_GET[MASK] == 6) |
| 39: |
{ |
| 40: |
$MASK='WPole.jpg'; |
| 41: |
} |
| 42: |
if ( $_GET[MASK] == 7) |
| 43: |
{ |
| 44: |
$MASK='WTube.jpg'; |
| 45: |
} |
| 46: |
if ( $_GET[MASK] == 8) |
| 47: |
{ |
| 48: |
$MASK='Wwheel.jpg'; |
| 49: |
} |
| 50: |
if ( $_GET[MASK] == 9) |
| 51: |
{ |
| 52: |
$MASK='Wwave.jpg'; |
| 53: |
} |
| 54: |
|
| 55: |
|
| 56: |
$image = getimagesize("$URL"); |
| 57: |
$type = $image['mime']; |
| 58: |
$width = $image[0]; |
| 59: |
$height = $image[1]; |
| 60: |
exec ("/usr/bin/composite over -tile $MASK $URL temp/masked.gif"); |
| 61: |
$rand=rand(1, 1000); |
| 62: |
$JPG="temp/Mask_$rand.jpg"; |
| 63: |
$GIF="temp/Mask_$rand.gif"; |
| 64: |
$PNG="temp/Mask_$rand.png"; |
| 65: |
|
| 66: |
$GRAVITY="-gravity Center"; |
| 67: |
$GEOMETRY="-geometry +0+0"; |
| 68: |
exec ("/usr/bin/composite -compose multiply $GRAVITY $GEOMETRY $URL temp/masked.gif $OUT"); |
| 69: |
|
| 70: |
print "<br><br><div align=\"center\">"; |
| 71: |
print "Click Below To Get Image & URL<br /><br />"; |
| 72: |
print "<a href=$OUT><img src=$OUT></a><br /><br />"; |
| 73: |
echo $OUT; |
| 74: |
print "</div>"; |
| 75: |
|
| 76: |
?> |
| 77: |
<html><body bgcolor="#00ffff" text="#000000"> |
| 78: |
<div align="center"> |
| 79: |
<h1>Gradient Slat Masks</h1> |
| 80: |
<table border="0" cellspacing="0" cellpadding="0"><tr><td width="500"> |
| 81: |
<h3>This tool will create a mask of your image with the gradient shaped tiled background. Enter an image URL, choose style of mask, type of image output and click Make Mask button.</h3></td></tr></table> |
| 82: |
<? |
| 83: |
echo "<form> |
| 84: |
<table border='0' cellspacing='5' cellpadding='0' bgcolor='#ffffff'><tr> |
| 85: |
<td align='center' colspan='5'> |
| 86: |
URL:<input type='text' name='URL'></td></tr><tr> |
| 87: |
<td colspan='5'><b>Choose Frame</b></td></tr><tr> |
| 88: |
<td align='center'> |
| 89: |
<input type='radio' name='MASK' value='1'><br><img src='WRoll.jpg' width='130'> |
| 90: |
</td><td align='center'> |
| 91: |
<input type='radio' name='MASK' value='2'><br><img src='WSquare.gif' width='130'></td><td align='center'> |
| 92: |
<input type='radio' name='MASK' value='3'><br><img src='WCorner.gif' width='130'></td><td align='center'> |
| 93: |
<input type='radio' name='MASK' value='4'><br><img src='Wdiagonal.gif' width='130'></td><td align='center'> |
| 94: |
<input type='radio' name='MASK' value='5'><br><img src='Wslats.gif' width='130'> |
| 95: |
</td></tr><tr> |
| 96: |
<td align='center' valign='top'> |
| 97: |
<input type='radio' name='MASK' value='6'><br><img src='WPole.jpg' width='78'> |
| 98: |
</td> |
| 99: |
<td align='center' valign='top'> |
| 100: |
<input type='radio' name='MASK' value='7'><br><img src='WTube.jpg' width='101'> |
| 101: |
</td> |
| 102: |
<td align='center' valign='top'> |
| 103: |
<input type='radio' name='MASK' value='8'><br><img src='Wwheel.jpg' width='130'> |
| 104: |
</td> |
| 105: |
<td align='center' valign='top'> |
| 106: |
<input type='radio' name='MASK' value='9'><br><img src='Wwave.jpg' width='91' height='91'> |
| 107: |
</td><td align='center' valign='top'>TYPE: |
| 108: |
<select name='OUT'> |
| 109: |
<option value=$JPG>JPG</option> |
| 110: |
<option value=$GIF>GIF</option> |
| 111: |
<option value=$PNG>PNG</option> |
| 112: |
</select><br> |
| 113: |
<br><br> |
| 114: |
<input type='submit' value='Make Mask'> |
| 115: |
</td></tr></table> |
| 116: |
</form>"; |
| 117: |
?> |
| 118: |
</div> |
| 119: |
</body></html>
|