Exemplo n.º 1
0
 function Portfolio($data)
 {
     $PORTFOLIO_PATH = "/portfolio";
     $this->pc_id = $data->pc_id;
     $this->pc_category = $data->pc_category;
     $this->pc_description = $data->pc_description;
     $this->id = $data->p_id;
     $this->title = $data->p_title;
     $this->link = $data->p_link;
     $this->url = $data->p_url;
     $this->thumb = $data->p_thumb;
     $this->basename = substr($data->p_thumb, 0, strpos($data->p_thumb, '.'));
     $this->homeimg = $this->getBaseName($data->p_thumb) . '_home.jpg';
     $this->intimg = $this->getBaseName($data->p_thumb) . '_int.jpg';
     $this->comments = $data->p_comments;
     $this->entry = format_textarea($this->comments);
     $this->thumb_file = "{$PORTFOLIO_PATH}/{$this->thumb}";
     if (file_exists('/home/toewsweb/public_html' . $this->thumb_file)) {
         $this->THUMB_HEIGHT = imageHeight($this->thumb, '/home/toewsweb/public_html' . $this->thumb_file);
     }
 }
Exemplo n.º 2
0
function imageWidth($fontsize, $stringlength)
{
    $imgWid = imageHeight($fontsize / 1.8) * $stringlength;
    return $imgWid;
}
Exemplo n.º 3
0
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// Consitnuously modified
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// NO CACHE*/
/**
 * Image Related Functions
 **/
include "functions/images.php";
$text_str = $_GET['text'] ? base64_decode($_GET['text']) : 'TITLE NOT MENTIONED';
$text_size = $_GET['size'] ? $_GET['size'] : 10;
// Define the variables
$textImg_font = "eict.ttf";
$textImg_width = imageWidth($text_size, strlen($text_str));
$textImg_height = imageHeight($text_size);
// Set Co-ordinates
$bluetext_bottom = floor($textImg_height - $text_size / 2);
//Create Image of size $textImg_length x $textImg_height
$background = imagecreatetruecolor($textImg_width, $textImg_height);
// Colors Used in the image
$text_fontcolor = imagecolorallocate($background, 4, 75, 162);
$text_shadowcolor = imagecolorallocate($background, 140, 140, 140);
$text_strokecolor = imagecolorallocate($background, 255, 255, 255);
//Make it transparent
imagesavealpha($background, true);
$trans_colour = imagecolorallocatealpha($background, 0, 0, 0, 127);
imagefill($background, 0, 0, $trans_colour);
// STRIP THE SLASHES IN THE TEXT
$text_str = stripslashes($text_str);
// FIRST PRINT THE SHADOW ON THE TRANSPARENT IMAGE
} else {
    print "something went wrong ...\n";
    exit;
}
if (encodeImageFile($image, "test.jpg", 80, "")) {
    print "image written all fine.\n";
} else {
    print "something went wrong writing the image ...\n";
    exit;
}
# advanced use, use in memory locations
$image_bits = `cat testsuite/tif/5.1.13.tif`;
if (decodeImage($image, $image_bits)) {
    print "image read from RAM.\n";
} else {
    print "something went wrong decoding the RAM\n";
    exit;
}
# image properties
print "Width: " . imageWidth($image) . "\n";
print "Height: " . imageHeight($image) . "\n";
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
print "Channels: " . imageChannels($image) . "\n";
print "Channel depth: " . imageChannelDepth($image) . "\n";
# setable as well
imageSetXres($image, 144);
imageSetYres($image, 144);
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
deleteImage($image);
Exemplo n.º 5
0
                        
                    </tr>
                    <? } ?>
                    <tr>
                    	<td><strong>Low resolution print</strong><br>2000 &times; <?php 
echo imageHeight(2000, $photo['width'], $photo['height']);
?>
 pixels</td>
                        <td><a href="asset.php?action=download&id=<?php 
echo $photo['id'];
?>
&width=2000" class="btn btn-link"><i class="fa fa-download"></i> Download</a></td>
                    </tr>
                    <tr>
                    	<td><strong>Screen</strong><br>850 &times; <?php 
echo imageHeight(850, $photo['width'], $photo['height']);
?>
 pixels</td>
                        <td><a href="asset.php?action=download&id=<?php 
echo $photo['id'];
?>
&width=850&output=jpg" class="btn btn-link"><i class="fa fa-download"></i> Download</a></td>
                    </tr>
                    <tr>
                    	<td>
                            <div class="row">
                            	<div class="col-xs-12 col-sm-6">
                                	<div class="form-group">
                                        <select name="output" id="output" class="form-control">
                                        	<option value="jpg">Select a Filetype</option>
                                        <? while($a_filetype = $a_filetypes->fetch_assoc()) { ?>