- Add ImageMagick 6.8.3-1 sources
This commit is contained in:
parent
b8db71063c
commit
615ec83706
3424 changed files with 1398702 additions and 0 deletions
37
ImageMagick-6.8.3-1/www/contrib/color-swatch.html
Normal file
37
ImageMagick-6.8.3-1/www/contrib/color-swatch.html
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
# Authors: Anthony Barnett and Fred Weinhaus: 10/24/2009
|
||||
|
||||
# set path to convert
|
||||
$path2convert = "/usr/local/bin/convert";
|
||||
|
||||
# Get the color and bgcolor value from the php page image tag as get parameter
|
||||
# Then create PNG image and send back
|
||||
$color = $_GET['color'];
|
||||
$bgcolor = $_GET['bgcolor'];
|
||||
|
||||
|
||||
# test for not valid characters in color and bgcolor
|
||||
$colortest = preg_match_all('/[^#%(),.0-9a-zA-Z]/', $color, $matches);
|
||||
$bgcolortest = preg_match_all('/[^#%(),.0-9a-zA-Z]/', $bgcolor, $matches);
|
||||
|
||||
if ( $colortest == 0 && $bgcolortest == 0 )
|
||||
{
|
||||
if ( $bgcolor == "checker" )
|
||||
{
|
||||
# Generate the checker background and overlay color
|
||||
$cmd = "$path2convert -size 150x150 pattern:checkerboard -normalize xc:\"$color\" -composite -depth 8 PNG:-";
|
||||
}
|
||||
else
|
||||
{
|
||||
# Generate the checker background and overlay color
|
||||
$cmd = "$path2convert -size 150x150 xc:\"$color\" -depth 8 PNG:-";
|
||||
}
|
||||
|
||||
# Set the header type
|
||||
header("Content-type: images/png");
|
||||
|
||||
# Display the image
|
||||
passthru($cmd, $retval);
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue