text:
If string $filename is given and it exists, it will be overwritten.
imagejpeg — Resmi tarayıcıya veya dosyaya yazar.
[, mixed
[, int
]] )
imagejpeg() işlevi
resim ile
belirtilen JPEG biçemli resmi tarayıcıya veya bir
dosyaya çıktılar.
imagecreatetruecolor() gibi bir resim oluşturma işlevinden dönen bir resim verisi.
Dosyanın kaydedileceği yol veya işlev döndüğünde
kendiliğinden kapanan açık bir akım kaynağı.
NULL atanırsa veya hiçbir şey
atanmazsa doğrudan ham resim akımı çıktılanır.
kalite değiştirgesini kullanmak için bu
NULL değeri vererek atlayabilirsiniz.
kalite isteğe bağlı olup 0'dan (en kötü kalite,
en küçük dosya) 100'e (en yüksek kalite, en büyük dosya) kadar bir
değer belirtilebilir. Öntanımlı değer, öntanımlı IJG kalite değeridir
(yaklaşık 75).
Başarı durumunda
TRUE, başarısızlık durumunda
FALSE döner.
Ancak, libgd resmi çıktılamakta başarısız olursa bu işlev
resource türünde bir akımın
değiştirgesine aktarılabilmesi eklendi.
çıktıyeri değiştirgesini atlamak için boş dizge
atanması men edildi.
Örnek 1 - Bir JPEG resmini tarayıcıya çıktılamak
// Bir resim taslağı oluşturup bir metin ekleyelim
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// İçerik türünü belirtelim
header('Content-Type: image/jpeg');
// Resmi çıktılayalım
// Belleği serbest bırakalım
Yukarıdaki örnek şuna benzer bir çıktı üretir:
Örnek 2 - Bir JPEG resmi bir dosyaya kaydetmek
// Bir resim taslağı oluşturup bir metin ekleyelim
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// Resmi 'basitmetin.jpg' ismiyle kaydedelim
imagejpeg($im, 'basitmetin.jpg');
// Belleği serbest bırakalım
Örnek 3 - Resmi 75% kaliteyle tarayıcıya çıktılamak
// Bir resim taslağı oluşturup bir metin ekleyelim
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
// İçerik türünü belirtelim
header('Content-Type: image/jpeg');
// çıktıyeri'ni NULL ile atlayıp kaliteyi 75% yapalım
imagejpeg($im, NULL, 75);
// Belleği serbest bırakalım
Aşamalı JPEG'ler çıktılamak isterseniz geçişimliliği imageinterlace() ile ayarlamalısınız.
If string $filename is given and it exists, it will be overwritten.
I didn't find any example like this on the Web, so I mixed pieces together.. hope this will save time to other people!
Here's a complete solution to READ any image (gif jpg png) from the FILESYSTEM, SCALE it to a max width/height, SAVE the scaled image to a BLOB field keeping the original image type. Quite tricky..
function scaleImageFileToBlob($file) {
$source_pic = $file;
$max_width = 200;
$max_height = 200;
list($width, $height, $image_type) = getimagesize($file);
switch ($image_type)
case 1: $src = imagecreatefromgif($file); break;
case 2: $src = imagecreatefromjpeg($file); break;
case 3: $src = imagecreatefrompng($file); break;
default: return ''; break;
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if( ($width <= $max_width) && ($height <= $max_height) ){
$tn_width = $width;
$tn_height = $height;
}elseif (($x_ratio * $height) < $max_height){
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
$tmp = imagecreatetruecolor($tn_width,$tn_height);
/* Check if this image is PNG or GIF, then set if Transparent*/
if(($image_type == 1) OR ($image_type==3))
imagealphablending($tmp, false);
$transparent = imagecolorallocatealpha($tmp, 255, 255, 255, 127);
imagefilledrectangle($tmp, 0, 0, $tn_width, $tn_height, $transparent);
imagecopyresampled($tmp,$src,0,0,0,0,$tn_width, $tn_height,$width,$height);
* imageXXX() only has two options, save as a file, or send to the browser.
* It does not provide you the oppurtunity to manipulate the final GIF/JPG/PNG file stream
* So I start the output buffering, use imageXXX() to output the data stream to the browser,
* get the contents of the stream, and use clean to silently discard the buffered contents.
switch ($image_type)
case 1: imagegif($tmp); break;
case 2: imagejpeg($tmp, NULL, 100); break; // best quality
case 3: imagepng($tmp, NULL, 0); break; // no compression
default: echo ''; break;
$final_image = ob_get_contents();
return $final_image;
So, let's suppose you have a form where a user can upload an image, and you have to scale it and save it into your database.
[..] // the user has clicked the Submit button..
// Check if the user entered an image
if ($_FILES['imagefile']['name'] != '') {
$image = scaleImageFileToBlob($_FILES['imagefile']['tmp_name']);
if ($image == '') {
echo 'Image type not supported';
} else {
$image_type = $_FILES['imagefile']['type'];
$image = addslashes($image);
$query = "UPDATE yourtable SET image_type='$image_type', image='$image' WHERE ...";
$result = mysql_query($query);
if ($result) {
echo 'Image scaled and uploaded';
} else {
echo 'Error running the query';
Regarding Carl Gieringer's comment, it is possible to have PHP files in utf-8. Just make sure the editor does not output BOM, which is unnecessary in utf-8 anyway.
Except for any editors from Microsoft, most programmer's editors that supports utf allows you to surpress BOM.
[[Editor's note: removed the header()-call since it is not required when outputting inline image-data]]
One single code line, solve-me after 3 hours of blind search!
here is:
... ob_start();
imagejpeg( $img, NULL, 100 );
imagedestroy( $img );
$i = ob_get_clean();
echo ""; //saviour line!
Here is the simple, but powerful script for creating thumbnails on the fly.
You can include the script
directly to www page - just put it in <img src= tag.
with width 150pix.
This resizer respects the ASPECT RATIO.
Here is the script:
// Use it this way: resize.php?pic=imageurl&width=width_in_pixels
// firstname.lastname@example.com 2004
header("Content-type: image/jpeg");
$im = imagecreatefromjpeg($pic);
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
if (($new_w<=0) or ($new_w>$old_x)) {
if ($old_x > $old_y) {
if ($old_x < $old_y) {
if ($old_x == $old_y) {
For those looking to grab the resolution of a JPEG image without using GD nor ImageMagic... I wrote this simple function.
Too bad GD doesn't have this very simple function for us to use...
function getJPEGresolution($filename){
// Read the file
ob_start(); // start a new output buffer
$image = file_get_contents($filename);
// grab DPI information from the JPG header
$outRez["xDPI"] = ord($image[15]);
$outRez["yDPI"] = ord($image[17]);
ob_end_clean(); // stop this output buffer
//xDPI and yDPI should equal in value... but we output both anyway...
}//end function getJPEGresolution
I worked out a script that allows the transfer of alphanumeric data to be placed on an image. The HTML feature is img src and the php feature is imagettftext. This simple code will increment from 1 to 3 on images.
//ImageCall.php -- This script will call a script to produce the image.
for($next = 1;$next < 4; $next++){
print "Image $next:
";
print "";
print "

";
//Image.php -- This script creates a square image and places the text on it.
// image size and color
$im = ImageCreate(77,77);
$color1 = ImageColorAllocate($im,0x66,0xCC,0x00);
$color2 = ImageColorAllocate($im,0x33,0x66,0x00);
$color3 = ImageColorAllocate($im,0x00,0x99,0x00);
$color4 = ImageColorAllocate($im,0x3D,0x3D,0x3D);
// image creation
ImageFilledpolygon($im, array (76,1,1,76,76,76),3,$color2);
// determine numeric center of image
$size = ImageTTFBBox(45,0,'impact',$_GET['$text']);
$X = (77 - (abs($size[2]- $size[0])))/2;
$Y = ((77 - (abs($size[5] - $size[3])))/2 + (abs($size[5] - $size[3])));
//places numeric information on image
//returns completed image to calling script
Header('Content-Type: image/png');
Here is a function to resize an image and maintain aspect ratio. It will resize jpeg, gif or png and could easily be modified to add bmp. The name field is the destination of the file minus the file extension:
//name= filename minus type
function createImage($uploadedfile,$newWidth,$name)
// Capture the original size of the uploaded image
return false;
switch ($info['mime'])
case 'image/jpeg':
$src = imagecreatefromjpeg($uploadedfile);
case 'image/gif':
$src = imagecreatefromgif($uploadedfile);
case 'image/png':
$src = imagecreatefrompng($uploadedfile);
return false;
//Change the filename to add the filetype
$size = getimagesize($uploadedfile);
// this line actually does the image resizing, copying from the original
// image into the $tmp image
imagecopyresampled($tmp,$src,0,0,0,0,$newWidth,$newHeight,$info[0], $info[1]);
switch ($info['mime'])
case 'image/jpeg':
imagejpeg($tmp,$filename,100); //100 is the quality settings, values range from 0-100.
case 'image/gif':
imagegif($tmp,$filename,100); //100 is the quality settings, values range from 0-100.
case 'image/png':
imagepng($tmp,$filename); //100 is the quality settings, values range from 0-100.
imagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request
// has completed.
return true;
if(!createImage($uploadedfile,100, "uploaded_images/imgname"))
echo "error";
I had similar problem with safe mode. My solution is:
before imagejpeg(), touch() etc.
and after everything:
strange, but it works
Looks like any specified resolution settings in a JPEG file get lost when using imageJPEG() function in a script.
I had a high resolution JPEG which i added text to with imagestringup() so my customer can print the emailed JPEG as a filled form, but printing both Graphics from Photoshop revealed that any JPEG created is downsampled to 72 dpi, while width and height is kept.
(72 dpi is the standard web resolution)
Nothing to wonder about, but maybe if you read this you dont need to scratch your head :)
I did an experiment with the image quality parameter of the imagejpeg() function when creating jpegs. I found the optimal image quality with file size is taken into account to be 80 - very close to the default value of 75.
Anything over 80 results in an unnecessary increase in file size without much increase in image quality.
Results and sample pictures: http://www.ebrueggeman.com/article_php_image_optimization.php
Regarding the code below, it only grabs the last byte of the DPI information in JFIF-mode. I was wondering why my 300-DPI file was being reported as 44. 300 - 256 = 44 of course.
If you wish to capture the jpg data into a variable, rather than outputting it or saving it into a file (perhaps so you can put it in a database), you might want to consider output buffering. Something along these lines should work:
ob_start(); // start a new output buffer
imagejpeg( $newimage, NULL, 100 );
$ImageData = ob_get_contents();
ob_end_clean; // stop this output buffer
for those who get the message "permission denied" or "unable to access": it looks like a problem with your writepermissions to this folder. no matter if you use windows- or linuxserver, be sure the correct user has the permission to write to the correct folder.
I had a problem with denied permissions when trying to upload AND resize an image having safe_mode on. This caused that I couldn't create the new file in which I wanted to resampled the image with nor with imagejpeg() nor with touch() and imagejpeg() after it.
Here is my solution, I didn't test, but it's possible, it is biting some memory:
function resize($image, $target_file) {
// $image is the uploaded image
list($width, $height) = getimagesize($image['tmp_name']);
//setup the new size of the image
$ratio = $width/$height;
$new_height = 500;
$new_width = $new_height * $ratio;
//move the file in the new location
move_uploaded_file($image['tmp_name'], $target_file);
// resample the image
$new_image = imagecreatetruecolor($new_width, $new_height);
$old_image = imagecreatefromjpeg($target_file);
imagecopyresampled($new_image,$old_image,0,0,0,0,$new_width, $new_height, $width, $height);
imagejpeg($new_image, $target_file, 100);
As you can see, the function moves the uploaded file where you want to save the resampled image (move_uploaded_file is not restricted by safe_mode) and then you can resample the image, because it was created by moving it already.
Note: the directory where you want to save the file must have permissions set to 0777.
I came here looking for something similar to the getJPEGresolution function, but noticed the drawbacks that were pointed out in the last post. So, after drawing on some other code examples on the web, I put together the following function which should always properly return the correct values. (But remember that you still need to have the EXIF extension installed with your instance of PHP for this to work!)
function jpeg_dpi($filename)
if ( exif_imagetype($filename) != IMAGETYPE_JPEG ) {
return false;
} else {
$exif = exif_read_data($filename, 'IFD0');
$x = $y = 0;
if ( isset($exif['XResolution']) && isset($exif['YResolution']) ) {
$x = intval(preg_replace('@^(\\d+)/(\\d+)$@e', '$1/$2', $exif['XResolution']));
$y = intval(preg_replace('@^(\\d+)/(\\d+)$@e', '$1/$2', $exif['YResolution']));
if ( !$x && !$y && $fp = fopen($filename, 'r') ) {
$string = fread($fp, 20);
$data = bin2hex(substr($string, 14, 4));
$x = hexdec(substr($data, 0, 4));
$y = hexdec(substr($data, 4, 4));
if ( $x || $y ) {
return array($x, $y);
return false;
This function returns an array with the x-resolution, y-resolution when they can be determined, otherwise FALSE.
Here's another on-the-fly thumbnail creation script.
When I scripted the pictuerviewer on my page, I had all the pictures only in full size and qualit, because I wanted the posibility für visitors to download the pictures.
But as Imagesizes of more than 4 MP are to large for websites, I created thumbnails and the smaller pictures on the fly. But I found out, that the Script needed too much RAM, especially in the thumbnail overview, when I had more then 50 thumbnails to create on the fly at the same time.
So I modified my image creator and my viewer to let them store images, that are created. So only the first visitor has to wait (which is usually me for controlling the uploads und updates), all other visitors get the stored images, which is much faster.
Create different folders. I have a main folder called 'imagesdb' and the tree subfolders full (Full quality images), show (images for the picture viewer) and thumb (for thumbnails in overview).
Store the script for example as image.php and link it like that:
$image_name = "foo.jpg";
$style = "show";
// I've taken the foldernames. It's easier. For the
//thumbnails replace "show" with "thumb".
$image_name = "imagesdb/$style/$image_name";
$image_name = "image.php?image_name=$image_name&style=$style";
// only if file doesn't exist call the on-the-fly creating file
Now the main script, stored in the file image.php:
$image_name = $_GET['image_name'];
$style = $_GET['style'];
// Now set the maximum sizes to the different styles.
// You may set additional styles, but remember to
// create the according subfolders.
switch($style) {
case "show":
$max_size = 800;
case "thumb":
$max_size = 125;
$dest_file = "imagesdb/$style/$image_name";
// set output file
$image_file = "imagesdb/full/$image_name";
// set source file
$size = getimagesize($image_file);
// get original size
if($size[0] > $size[1]) {
$divisor = $size[0] / $max_size;
else {
$divisor = $size[1] / $max_size;
// to get allways pictures of the same size, which ist
// mostly wanted in imageviewers, look what ist larger:
// width or height
$new_width = $size[0] / $divisor;
$new_height = $size[1] / $divisor;
// set new sizes
settype($new_width, 'integer');
settype($new_height, 'integer');
// sizes should be integers
$image_big = imagecreatefromjpeg($image_file);
// load original image
$image_small = imagecreatetruecolor($new_width, $new_height);
// create new image
imagecopyresampled($image_small, $image_big, 0,0, 0,0, $new_width,$new_height, $size[0],$size[1]);
// imageresampled whill result in a much higher quality
// than imageresized
// the original data are no longer used
header("Content-type: image/jpeg");
if($style=="show" || $style=="thumb") {
imagejpeg($image_small, $dest_file, 100);
// if you have set additional sizese put them in the
// if-arguments, too.
// if someone calls the image.php directly in the
// browser with imagenames allready existing, they
// won't be overwritten
imagejpeg($image_small, '', 100);
// finally send image to browser and destroy no longer
// needed data.
As this website helped me for several times in the past and for creating this script, I hope I can help others with this script saving the time for developing a much more performant solution than an allways-on-the-fly-creating script.
With regard to chris.calo's code:
// The following block retrieves the source file. It assumes the filename extensions match the file's format.
if ( strpos($source_file,".gif") ) { $img_source = imagecreatefromgif($source_file); }
if ( (strpos($source_file,".jpg")) || (strpos($source_file,".jpeg")) )
... etc.
It assumes more than that, namely that the filename does not contain the strings '.gif', '.jpg', '.jpeg', '.bmp', or '.png' *anywhere* in the string. Some valid files with special filenames could break this; for example, a file named "used.to.be.a.png.file.gif" would cause this script to attempt to load the file as a PNG. Obviously this is a rare case, but the issue could be easily avoided by using "else ifs" (uses less CPU time) or checking that the extension abuts the end of the string or both.
That said, the whole business could be avoided if PHP didn't clutter the namespace with different functions to do the same thing with different image formats. Ick.
Please note that there is a bug report open for the currently broken safe_mode behaviour on this function:
According to the PHP staffer who has responded the docs are wrong (I don't agree but I'm also not their employee).
The work around is to use touch() (or any other file system function that can do this) to create the file first before using imagejpeg().
>>Bram Van Dam's
note below is missing "()" from the ob_end_clean call:
ob_end_clean; // stop this output buffer
should read
ob_end_clean(); // stop this output buffer
You can then use this for adding content-length headers (for example flash requires a content length in advance to create loaders)
ob_start(); // start a new output buffer
imagejpeg( $newimage, "", 90 );
$ImageData = ob_get_contents();
$ImageDataLength = ob_get_length();
ob_end_clean(); // stop this output buffer
header("Content-type: image/jpeg") ;
header("Content-Length: ".$ImageDataLength);
echo $ImageData;
A word of warning when outputting images to the browser...
Make sure there is no extra spaces around the <?php ?> tags, in the file you are editing, and also any included files.
I began to think there was a bug in GD or something, and I checked the file I was working on, but forgot about the includes...
Hours gone..
Don't forget that JPEG compression has artifacts! And they're not all really obvious. The PHP JPEG compression is pretty decent, but it seems to generally:
-Lighten the image overall, by a reasonable amount (never seen this before, but it will drive graphic designers crazy, you might want to darken the image before compressing it)
-Reduce saturation, especially with images with lots of points of different color within a few pixels of each other (this is a documented feature of JPEG)
-Seriously mess with blue colors, which is common to all JPEG but really annoying in some situations with blue and black or other detailed blue parts
You might want to consider using imagepng() and outputting a PNG image instead of a JPEG if any of the above affect you, or your image is not very photo-like. Sometimes I have an algorithm compare JPEG to PNG for an image and send the smaller version to the user.
Also, when using imagepng(), you should use imageinterlace() before it 95% of the time. Interlaced JPEGs load progressively, improving in quality as the image loads, so users on slower connections see the whole image at low quality. All this happens without affecting the file size (actually, sometimes the file size is smaller!) or final quality.
Hope this helps a few people out. It's not all that obvious without lots of playing around.
Rather than using the temporary file, as described above, you can buffer the output stream. Someone else showed me this, and it seems to work very nicely.
//Start buffering the output stream
// output the image as a file to the output stream
//Read the output buffer
$buffer = ob_get_contents();
//clear the buffer
//use $buffer as you wish...
Here is sample function that creates thumbnail of source JPEG file. Thumbnail wil be in square form (with and height are the same), and original image cropped to fit in.
$p_thumb_file - name of the file (including path) where thumb should be saved to
$p_photo_file - nam of the source JPEG file (including path) thatthumbnail should be created of
$p_max_size - with and height (they will be the same) in pixels for thumbnail image
$p_quality - quality of jpeg thumbnail
function photoCreateCropThumb ($p_thumb_file, $p_photo_file, $p_max_size, $p_quality = 75) {
$pic = @imagecreatefromjpeg($p_photo_file);
if ($pic) {
$thumb = @imagecreatetruecolor ($p_max_size, $p_max_size) or die ("Can't create Image!");
$width = imagesx($pic);
$height = imagesy($pic);
if ($width < $height) {
$twidth = $p_max_size;
$theight = $twidth * $height / $width;
imagecopyresized($thumb, $pic, 0, 0, 0, ($height/2)-($width/2), $twidth, $theight, $width, $height);
} else {
$theight = $p_max_size;
$twidth = $theight * $width / $height;
imagecopyresized($thumb, $pic, 0, 0, ($width/2)-($height/2), 0, $twidth, $theight, $width, $height);
ImageJPEG ($thumb, $p_thumb_file, $p_quality);
Thanks to Stuart and Darren for the corrections to the create_thumbnail function. Another note on that function: imagecreatefromwbmp was incorrectly used. WBMPs are wireless bitmaps, not windows bitmaps (thanks to clambert at whitecrown), so the thumbnail routine as is will not be able to handle windows bitmaps. See the notes at http://us2.php.net/manual/en/function.imagecreatefromwbmp.php for tips on working with windows bitmaps.
Thanks to Chris dot Calo for the thumbnail snippet. The file type issue is easily resolved by getting the type from the file with getimagesize, and you can handle unsupported types at that stage too. Thus:
list($img_width,$img_height, $type) = getimagesize($source_file); // Get the original dimentions
if ($type != 1 && $type != 2 && $type != 3 && $type != 15) { die("Your file is not a supported format"); }
...and then later check the type again to open the image correctly:
if ( $type == 1 ) { $img_source = imagecreatefromgif($source_file); }
else if ( $type == 2 ) { $img_source = imagecreatefromjpeg($source_file); }
else if ( $type == 3 ) { $img_source = imagecreatefrompng($source_file); }
else if ( $type == 15 ) { $img_source = imagecreatefromwbmp($source_file); }
function create_thumbnail( $source_file, $destination_file, $max_dimension)
list($img_width,$img_height) = getimagesize($source_file); // Get the original dimentions
$aspect_ratio = $img_width / $img_height;
if ( ($img_width > $max_dimension) || ($img_height > $max_dimension) ) // If either dimension is too big...
if ( $img_width > $img_height ) // For wide images...
$new_width = $max_dimension;
$new_height = $new_width / $aspect_ratio;
elseif ( $img_width < $img_height ) // For tall images...
$new_height = $max_dimension;
$new_width = $new_height * $aspect_ratio;
elseif ( $img_width == $img_height ) // For square images...
$new_width = $max_dimension;
$new_height = $max_dimension;
else { echo "Error reading image size."; return FALSE; }
else { $new_width = $img_width; $new_height = $img_height; } // If it's already smaller, don't change the size.
// Make sure these are integers.
$new_width = intval($new_width);
$new_height = intval($new_height);
$thumbnail = imagecreatetruecolor($new_width,$new_height); // Creates a new image in memory.
// The following block retrieves the source file. It assumes the filename extensions match the file's format.
if ( strpos($source_file,".gif") ) { $img_source = imagecreatefromgif($source_file); }
if ( (strpos($source_file,".jpg")) || (strpos($source_file,".jpeg")) )
{ $img_source = imagecreatefromjpeg($source_file); }
if ( strpos($source_file,".bmp") ) { $img_source = imagecreatefromwbmp($source_file); }
if ( strpos($source_file,".png") ) { $img_source = imagecreatefrompng($source_file); }
// Here we resample and create the new jpeg.
imagecopyresampled($thumbnail, $img_source, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height);
imagejpeg( $thumbnail, $destination_file, 100 );
// Finally, we destroy the two images in memory.
So.. after messing around with this beast of a function for hours, I discovered that it DOES NOT preserve the resource it is using the create the image, nor do imagepng() or imagegif(). By this I mean that you can not run two imagejpeg(), imagepng() or imagegif() calls on the same resource. Another possibly undocumented quirk... :-(
Rewrote the manual example into this function for creating a thumbnail image:
function thumbnail_jpeg ($original, $thumbnail, $width, $height, $quality) {
list($width_orig, $height_orig) = getimagesize($original);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
else {
$height = ($width / $width_orig) * $height_orig;
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($originial);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
imagejpeg($image_p, $thumbnail, $quality);
When displaying an image using imagepng or imagejpeg, you may want/need to call "header("Content-type: image/jpeg")" before the imagepng and imagejpeg functions.
It appears that some servers/browers are striping out the default header so the image is not rendered and appears as raw data.
(Firefox 1.02+ and OSX Safari for example)
I have changed one line in the script of Kokesh
25-Jun-2004 06:42 listed above, and now it generates better quality thumbnails.
You have to change function imagecopyresized() to imagecopyresampled()
For best results, use only loss-less file formats (such as PNG) for storing images or image parts that you later intend to output with this function.
Don't be like me racking my brain for hours trying to figure out why my xxx.php file outputs http://localhost/xxx.php as a one line response.
Most likely, you have either:
1. whitespaces before or after the php tags
2. need to set header('Content-type: image/jpeg');
3. if you have required files...be sure nothing is outputted...no test print statements because page expects image information
4. there is an error in your code
in my case, it was 4. there is a reason why the function call base64decode does not work...
it's actually: base64_decode()
by the way, other ways to validate your image encoded in base64 is to use the following tag:
echo '';
I was pulling a blob encoded base 64 data from mysql database and trying to render it on a page
hope this helps someone.
[Editor's note: fixed according to the note of roberto at ilpiola.it]
I could not find any information on changing the DPI information on a JPG file using the GD lib. Since changing this does not resize or scale the actual image, it is only a header-setting.
The following snipplet will save your $image to $file and set the DPI to 150.
imagejpeg($image, $file, 75);
// Change DPI
$dpi_x = 150;
$dpi_y = 150;
// Read the file
$size = filesize($file);
$image = file_get_contents($file);
// Update DPI information in the JPG header
$image[13] = chr(1);
$image[14] = chr(floor($dpi_x/256));
$image[15] = chr( $dpi_x%256);
$image[16] = chr(floor($dpi_y/256));
$image[17] = chr( $dpi_y%256);
// Write the new JPG
$f = fopen($file, 'w');
fwrite($f, $msg, $size);
P.s. not fully tested (yet) but it works for my images ...
I came across a problem where Internet Explorer refused to cache some dynamically created images. To get round this, send out a Last-Modified header.
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $timestamp).' GMT');
header('Content-Type: image/jpeg');
I noticed through testing that my previous function would not always return the data requested... this is due to the fact that some cameras and software dont correctly write the DPI info in the JFIF header... So, my 2nd solution is to read the exif info (if available) and output the first non-zero value as the DPI...
function getJPEGresolution($filename){
if(exif_imagetype( $filename)!= IMAGETYPE_JPEG) return(false);
// Read the file
$exif = exif_read_data($filename, 'IFD0');
ob_start(); // start a new output buffer
$image = file_get_contents($filename);
// grab DPI information from the JPG header
$outRez["xDPI"] = (int)(ord($image[15])>0? ord($image[15]) : $exif['XResolution'] );
$outRez["yDPI"] = (int)(ord($image[17])>0? ord($image[17]) : $exif['YResolution'] );
ob_end_clean(); // stop this output buffer
//correct output if header doesn't contain dpi info:: use exif info instead
$outRez["xDPI"] = ($outRez["xDPI"]>0? $outRez["xDPI"] : $exif['THUMBNAIL']['XResolution'] );
$outRez["yDPI"] = ($outRez["yDPI"]>0? $outRez["yDPI"] : $exif['THUMBNAIL']['YResolution'] );
//double check values; make sure it's just a number and not "72/1" ...
if(!is_numeric($outRez["xDPI"])) $outRez["xDPI"] = (int)substr($outRez["xDPI"], 0, strpos($outRez["xDPI"],"/",1));
if(!is_numeric($outRez["yDPI"])) $outRez["yDPI"] = (int)substr($outRez["yDPI"], 0, strpos($outRez["yDPI"],"/",1));
//xDPI and yDPI should equal in value... but we output both anyway...
}//end function getJPEGresolution
For those whom needs other dpi image than the GD library, just do the following:
//Get jpeg image contents
imagejpeg($image, "", 100);
$image = ob_get_contents();
//Or read jpeg image
$image = file_get_contents($file);
//Replace header image info to set DPI as units and the density for X and Y
//First parameter are units for X and Y densities (0x00 No units, 0x01 DPI, 0x02 DPC)
//Second parameter is the X density
//Third parameter is the Y density
$image = substr_replace($image, pack("Cnn", 0x01, 300, 300), 13, 5);
header("Content-type: image/jpeg");
header('Content-Disposition: attachment; filename="'.basename($file).'"');
echo $image;
in addition to my THUMBNAIL GENERATOR script:
i forgot to say, src path must not be http:// but server path (e.g. for some linux server: src=/home/users/user1/public_html/images/image1.jpg) or relative path, as in example in script (src=test.jpg, src=../test.jpg, src=pictures/test.jpg...)
In regards to adding images (or any other binary file) to a database, unless you absolutely *have* to, a MUCH better solution is to simply save the file you create to a directory and update your database with a URL to this file.
When I first started DB development I was hung up with BLOBs and how to make them effectively work with PHP but realized that they can severely impact performance and you also limit what you can do with those files once they're inside the DB.
If you can avoid using BLOBs, and most people can, then by all means just create a look-up table for your file urls and save them to a directory to store the files. File access and scalability will be greatly increased in most cases.
The following was developed using Mac OSX ( Linux ). The ghostscript call would have to be changed on a Windows box...
In an application I was developing, I needed to create .jpg thumbnails from .pdf uploaded files. After some research, I found one easy way to accomplish this was ( SIMPLIFIED ):
exec("sw/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=jpeg
-sOutputFile=test.jpg theFile.pdf");
This of course assumes that ghostscript is installed on the server, you have permissions, yada...
Essentially this calls on ghostscript to do the conversion.
So, then, once the new .jpg is created, it needed to be resized to accomodate the UI. Though I could easily do it from the command line with "convert", I was having issues using this command from PHP ( it's not my first language ). I found this thread while groping for a different method, and found an unworkable solution that stimulated me to write the following:
( commented out lines were for debug, but might prove instructional for your own purposes, so I left them in )
[This function takes in a .jpg file to be converted to a thumbnail, the new width you want the thumbnail to be, and the name to which you want the thumbnail saved. It then creates the thumbnail]
function createImage( $upload, $newWidth, $name )
if (!$info = getimagesize($upload) )
return false;
//echo "width: " . $info[0] . "
";
//echo "height: " . $info[1] . "
";
//create crude aspect ratio:
$aspect = $info[0] / $info[1];
$newHeight = round( $newWidth/$aspect );
//echo "$newHeight
";
$src = @imagecreatefromjpeg("$upload");
if ( !$src )
return false;
$tmp = @imagecreatetruecolor( $newWidth, $newHeight );
imagecopyresampled( $tmp, $src, 0, 0, 0, 0, $newWidth,
$newHeight, $info[0], $info[1] );
imagejpeg( $tmp, $name, 100 );
imagedestroy( $src );
imagedestroy( $tmp );
return true;
$upload = the path to the file you want to make a thumbnail from.
$newWidth = the width of your thumbnails.
$name = the path ( including name ) of the thumbnail you're creating.
If I have test.jpg in my servers root directory, and I want a thumbnail
with a width of 120 pixels, with the name thumb.jpg also to be saved
in the servers root directory, I'd call this function thus:
createImage("test.jpg", 120, "thumb.jpg");
I hope this makes life easier for somebody.
Hope someone will find this usefull... save it to thumb.php and use it for on-the-fly thumbnails generating

// by firstname.lastname@example.com
// proportional on-the-fly thumb generator from JPG images
// usage example:
//
// parameters: src = source image
// wmax = max width
// hmax = max height
// quality = JPG quality of generated thumb - optional.
// if not specified, quality=90
// bgcol = if specified, allways generates exact wmax x hmax sized thumb,
// with bacground color bgcol and centered source image
// note: if source image is smaller than desired thumbnail, it will not be resized!
header("Content-type: image/jpeg");
$source = imagecreatefromjpeg($src);
if ($orig_w>$wmax || $orig_h>$hmax)
if ($thumb_w/$orig_w*$orig_h>$thumb_h)
} else
if (!@$bgcol)
if (!@$quality) $quality=90;
If imagejpeg brings up this warning:
Warning: imagejpeg(): Unable to access data ...
it could be a problem with "Safe Mode". A solution could be to touch the new file before, like:
imagejpeg($image_p, $newfile, 100);
i had the same problem as tobylewis had
when i tried to call imagejpeg(), width porperly parameters given it displayed
imagejpeg(): Unable to access usr/home/public_html/pic1.jpg
imho if not correctly configured server this function is not allowed to create the file on disk.
the workaround however is if you create the file using some other function, before call imagejpeg(). something like this
imagejpeg($dest,$file_name_dest, $quality);
Every script I was writing was giving me an error.
When writing the following code I was able, as a client, to browse the website and save the images (Save image as...) with IE. Yet with Firefox and family the browser tried to save them as 'script_name.php' instead of 'image_name.jpg'.
header("Content-Type: image/jpeg");
imagejpeg($image,'',100); // Output to Browser
After trying to save all the watermarked images or saving the image as 'temp.jpg' before outputing it to user, I've read this topic on BugZilla that advised to add the following header:
header("Content-Type: image/jpeg");
header("Content-Disposition: attachment; filename=image_name.jpg"); // THIS ONE
Sorry about the English.
If like me you like to rename uploaded images and add the time to the file name so you never end up with two images with the same name.
Watch out because you can save a file on your server using illegal characters such as a colon ":"
030363 6-01-2014 18:05:29 image.jpg
I spent ages trying to work out why my FTP program would not download the images created with PHP
I guess this might be dependent on what file system your using but it wouldn't let me download the images to a windows file system.
But I can obviously create files on my Linux server with a colon in the file name.
Just wanted to mention that the create_thumbnail script below fails on uppercase filenames. Many cameras default to IMG_XX.JPG and since strpos is case sensitive it fails.
I changed all the strpos to stripos and it worked wonderfully.


text:
|View Poll Results: Shakugan no Shana III - Episode 24 Rating
|Perfect 10
|9 out of 10 : Excellent
|8 out of 10 : Very Good
|7 out of 10 : Good
|6 out of 10 : Average
|5 out of 10 : Below Average
|4 out of 10 : Poor
|3 out of 10 : Bad
|2 out of 10 : Very Bad
|1 out of 10 : Painful
|Voters: 149. You may not vote on this poll
|Thread Tools
|2012-03-23, 22:16
|Link #21
Junior Member
Join Date: Mar 2012
|2012-03-23, 23:55
|Link #24
a random Indonesian otaku
Join Date: Dec 2009
Location: Xanadu
Age: 26
actually I want to wait until subbed version out.... but somehow I can't resist the temptation
so I watch it...
omg... I don't know Japanese but I must give this episode 10/10 (wait! someone gives 1/10 score??!!!)
so what I get are :
1. Flame Haze go to Xanadu (but I don't know about Sophie... at the end, she looks like holding a teleconference between real world and Xanadu)
2. Indeed... Wilhelmina has changed a lot... Justus will get a good mother... so Justus is like a combination of Johan and Pheles existence
3. That battle... omg... I almost think Yuji want to bring Yoshida with him (wow! Kristen must be very happy)... I don't really get all of Yuji's plan.. .but I can understand most of them from Deathscyther's explanation (thanks a lot)... conclusion, Yuji plans to be a martyr... blaming all mistakes to himself while trying to take responsibility in watching good relationship between human and tomogara and flame haze
Finally, I can hear 'urusai' trademark again with a huge flame buster from Shana (this is the first time during 3rd season)
4. The kiss.... awwww.... finally Yuji gives up... waiting for 76 episode is totally worth it (24 season I + 24 season II + 4 OVA)
5. in the ending, I feel very sad when they show the picture of Ike-Yukari-Yuji... so Yuji's existence is completely disappeared... Satou and Margery are married, right?
I might write more but I must wait the subbed version
in my opinion this is one of the best happy ending I ever watched... even better than Clannad, Angel Beats, etc
|2012-03-24, 00:30
|Link #26
Join Date: Jan 2009
Age: 28
|2012-03-24, 01:21
|Link #28
Senior Member
Join Date: Oct 2011
Can't.. calm down.. freaking.. kiss was THE BEST!! XD I've been dreaming of the day I'd see the kiss scene, just like a hardcore Shanite fan I am.
Best episode out of all sns episodes. Why? Because of the kiss of course! I've loved everything about this episode, though I'm a little disappointed that they didn't animate Shana singing to Yuji at the end. Oh well, Who cares? J.C staff has done a fabulous job. I thank all the people in J.C staff helped animate this whole series. Also, Yashichiro Takahashi for creating this beautiful story for us to adore!
Good bye Shakugan no shana.. I'll definitely miss you terribly.. and I'll always remember this series. Shakugan no shana will definitely stay in my heart forever.
Now.. I need to calm down.. and go repeat the same kiss scene again...
EDIT: Okay, I've calmed down. Anyway, I loved how they added the very first opening song in the episode and Wilhelmina was blushing. Also, how Shana went full-on spazz when she was fighting with Yuji and how she pwned him But surprisingly, she immediately calmed down from her full-on rage when she flew with Yuji up in the sky. O_o Aside from the kiss, Margery is a more nicer character.. when she fought in the fight I could definitely notice the big change in her and how shes smiling because of Keisaku. Seriously, Love can do wonders.
Last edited by redflame; 2012-03-24 at 01:35.
|2012-03-24, 01:34
|Link #29
Join Date: Feb 2009
Like everyone else here I couldn't wait to watch it subbed(what's with all these delays!?). I must say what an ending to this outstanding anime series, it has been a long ride and I will most certainly miss it.
For those of us who wish to thank the creators, staff, etc for their hard work and dedication over the years - apparently the official site's front page has been updated for quite sometime now with when the anime series began and ended, as well as pages where you can view/post thank you comments. There are very few english comments so don't hesitate to post.
http://arigatou.shakugan.com/ - fill out the form with your name and a message(140 characters max) that you would like to post.
http://www.shakugan.com/arigatou/ - where all the comments are posted, different comments are shown each time you hit the reload button at the bottom.
|2012-03-24, 03:22
|Link #30
a random Indonesian otaku
Join Date: Dec 2009
Location: Xanadu
Age: 26
|2012-03-24, 05:01
|Link #31
Senior Member
Join Date: Jan 2011
Location: Philippines
|2012-03-24, 05:34
|Link #33
Senior Member
Join Date: Feb 2008
Location: The Netherlands
Age: 30
The last few episode were pretty hard for Yoshida. The person who welcomed her into this world, Khamsin, died while protecting her. Whilhelmina, who she became quite close with, left towards the new world with Justus, the existence that was able to come to be because Kazumi protected him.
Yuji, her love interest, and Shana, her friend and rival in love, departed to Xanadu together without saying their goodbyes. I guess that they had to hurry, since the doorway to Xanadu was closing. The doorway closed as soon as Yuji and Shana went through after all. It must have been hard on Yoshida to see those two disappear like that.
But in the end there is no reason for her to be sad. She probably won't ever see Yuji and Shana again and her friends (except for Margery, Satou and Eita) have completely forgotten about them, but she'll never forget them. She'll never forget the happy times that she spent with them. She'll always remember that those two have always protected her, her friends, her family, her city and her world with their actions. Although she probably wants to be with those two that she came to love, she knows that they're happy together and that they're still working hard towards the goal to make humans and tomogara coexist.
She's still alive. She still has her family and her friends. On top of that, her best friend Hirai Yukari has been brought back. She's not alone. Knowing Kazumi, she'll work hard for her own goals from now on as well.
I don't think that there's any direct connection between this world and Xanadu either, just like there's no direct connection between this world and Guze.
It wasn't the first time this season though. She said it in episode 4 as well.
Last edited by Deathscyther; 2012-03-24 at 05:52.
|2012-03-24, 06:45
|Link #35
Senior Member
Join Date: Feb 2011
Zero no Tsukaima just ended and it made me feel like watching the last episode of Shana again. Well it's because both series:
Spoiler for ZnT F ep12:
But Shana's ending was better and more memorable. I'm gonna miss both series.
I wonder if JC Staff will complete Hidan no Aria (assuming there will be more seasons) since it belongs in the same group as Shana, Zero no Tsukaima and Toradora.
Last edited by AP24; 2012-03-24 at 07:50.
|2012-03-24, 07:50
|Link #36
a random Indonesian otaku
Join Date: Dec 2009
Location: Xanadu
Age: 26
Indeed... Yoshida needs more love...
but she is someone who can move forward and facing future... she's not weak!
too bad that Yuji and Shana never manage to say a proper 'goodbye' to her (unlike Johan and Pheles)
well... it's better if all of Flame Haze go to Xanadu. I don't see any reason for them to stay in earth again... (except Margery)
but so far, J.C. staff only does a very good work in Shakugan no Shana and Toradora... when I first watch Hidan no Aria or ZnT.. I don't get the same feeling like when I first watch SnS and ToraDora... I don't know what is lacking but J.C. staff best work for me is Shakugan no Shana... that's all
|2012-03-24, 07:50
|Link #37
Senior Member
Join Date: May 2011
They are not being mean, it's just much more fitting that way, I think. At least I got the feeling that this really was well done when reading the chapter.
|2012-03-24, 08:43
|Link #38
Senior Member
Join Date: Feb 2008
Location: The Netherlands
Age: 30
And what about the new tomogara that will come from Guze? I don't think that new tomogara will stop coming from Guze, just because there's a new world now. The tomogara in Guze probably don't even know about our world and Xanadu. They probably just end up somewhere in our world (and maybe now Xanadu too) after exiting Guze. That's something that still kind of bugs me to be honest. We don't know much about guze. Just how did tomogara live there? How did they cross over to our world? If it's possible between Guze and our world, then maybe someday a way between this world and Xanadu can be found as well.
So there's a good reason for flame haze to stay in this world.
Yuji got the control key of Tartaros that was placed around the city. It was used as some sort of barrier to make sure people can't get hurt because of the final battle between him, Shana, Margery and Sydonay. I don't think that this control key of Tartaros also has the power to 'close/negate' the doorway to Xanadu. Tartaros can indeed be used in many different ways, but I think that's only the case when you have the whole treasure tool. I don't think that's the case when you only have one control key. It can probably be used for one thing only.
And why would Yuji close the door? He wants as many tomogara as possible to head to the new world after all.
Last edited by Deathscyther; 2012-03-24 at 08:55.
|2012-03-24, 08:51
|Link #39
A true 灼眼のシャナ Shanite. :D
Join Date: Sep 2011
Location: ... DON'T BE A STALKER! ... ⊂((・⊥・))⊃
This episode was just beautiful. From Yuji & Shana's final battle to Syndonay & Margery's final battle, everything was well done. The animation, fighting, terrific use of timing, EVERYTHING.
The kiss and then the ending was so nicely done that I literally cried.
Now that the series is over, I believe that no other series will best this #1 choice of mine. I've been a happy and moved fan since the series started and will always be no matter what.
SnS forever!!!!!
|2012-03-24, 09:09
|Link #40
Senior Member
Join Date: Jan 2011
Location: Philippines
Wow now we're kinda talking about Yoshida here but oh well. In this season she somehow changed... from being annoying to normal.
|Thread Tools

subset: commoncrawl


text:
Isla Fisher & Jesse Eisenberg: 'Now You See Me' Premiere!
Isla Fisher is classy chic while attending the premiere of her new flick Now You See Me held at AMC Lincoln Square on Tuesday (May 21) in New York City.
The 37-year-old Aussie actress was joined by her co-stars Jesse Eisenberg, Mark Ruffalo, Morgan Freeman, Woody Harrelson, Melanie Laurent, and Michael Caine.
PHOTOS: Check out the latest pics of Isla Fisher
Zosia Mamet was also spotted attending the premiere.
Last week, Isla was spotted promoting the flick on The Graham Norton Show in London.
FYI: Isla is wearing a L'Wren Scott dress, Yossi Harari jewelry, a Monique Pean ring, and carrying a Roger Vivier clutch.
10+ pictures inside of Isla Fisher and Jesse Eisenberg attending the premiere of Now You See Me…


text:
I was just wondering if my supply is truly low [which is probably isnt] or if its just possible adjusted as you said, to regulate exactly how much milk is being removed, which is probably more likely the case. My DD seems happy and content and never acts more hungry and her diaper output is fine so far. I suppose I was just so used to having much more milk, that this is all new to me....especially the slower let downs...the used to be almost immediate now I have to wait 4-6 mins to get one when pumping. [annoying....lol].
Since this all started I have adding an extra pumping session and going to try and pump 3 times while at work instead of just twice.


text:
Music you know nothing about...
Bass music or High Energy Bass.
My friend is playing Bangface in London on Friday night and I realise I know nothing about this kind of music and it's hard to get into.
- stalecloud and sunstroke_house this'd this
Nice one, I am going to see Yeahhbuzz.
I am actually pretty excited to see him play, his biggest gig yet.
this isn't exactly Blus.
at all, in fact. it's 20's beat poetry - it's got blues in it, jazz, gospel......I think you might like it
- thesewoodenideas this'd this
I do like this, indeed.
Not sure what it is, though.
Yes, exactly stuff like this.
I just need a big playlist/comp to skim through and see what stuff I like and go on from there, I guess.
John Lee Hooker
Always satisfies my blues vibe when I get the urge. He's got a wicked kinda groovy boogie style of playing the stright up blues style even when its him just on accoustic guitar that it adds a nice energy to it.skellywager this'd this
Some of the obvious Delta chaps
Robert Johnson - http://www.youtube.com/watch?v=dloPrGI0EuY
Leadbelly - http://www.youtube.com/watch?v=TRmL9oktDtA
Blind Willie Johnson - http://www.youtube.com/watch?v=t5HaHVKRouo
Blind Willie McTell - http://www.youtube.com/watch?v=kRp02P8SfVA
Blind Boy Fuller - http://www.youtube.com/watch?v=3ISfX91HERc
Bukka White - http://www.youtube.com/watch?v=szGRsuK8MbM
Blind Lemon Jefferson - http://www.youtube.com/watch?v=zb8EL6WrTwg
- Icarus-Smicarus and JaguarPirate this'd this
- Oissin_, spiritofjazz, and andyvine this'd this
Jazz finally clicked for me a few years back
when, like a lot of people I guess, I listened to Kind of Blue for the first time. It's subsequently led me down a lot of interesting rabbit holes. I still know next to feck all about it myself, but I'm starting to know what I like.freddiehubbard this'd this
I've done the listening to Kind of Blue thing
I like it and mean to explore more jazz but just as I was about to I got distracted by electronica (which I hadn't listened to much of at that point). Generally I get obsessed with one other genre to go along with my standard diet of indie, pop, rock and folk. It has variously been hip hop, classical and metal. Funk and jazz are in the back of my mind, who knows when the mood will take me.
Have a go at Coltrane next
Would suggest Giant Stepsthekidswhopoptoday this'd this
It's all about Wayne Shorter
And I'd much rather My Favourite Things than Giant Steps.
Listening to John Coltrane has been one of the best decisions I've ever made
http://www.youtube.com/watch?v=hsxZuPXNGnU - The Love Supreme record (part 2, Resolution in particular - http://www.youtube.com/watch?v=NK-ne6AxAYE) had an effect on me similar to the one people seem to relate to when discussing the first time they heard Loveless or tried peanut butter or something else important...
The way Trane wrote music and arranged his band along with developing his own playing style is completely unique and can be chronicled across so many different albums which range from easy going, utterly beautiful and melodious standards (Soul Trane & Blue Train) to batshit free jazz noise jamming (Om, Ascension). I like his spirituality as well, it goes as a nice side to the authenticity of a lot of his music - he spoke a lot of stuff about trying to 'better his soul through his playing' and what have you. really interesting. mind you, he was doped to the eye balls by that point.
great guy.
anyway, hearing Resolution
damn...ignore that bottom bit.
the peanut butter thing stands though.
It's difficult to not sound pretentious when discussing Jazz
Just give him an album to listen to you berk.
This is the only jazz album i know
but it's fucking amazing: http://www.youtube.com/watch?v=0wgA9L5TN5M
or pretty much any London urban music that isn't made by posh kids
love some doo wop
one of my fav songs ever:
Technical death metal
Progressive death metal
Progressive black metal
Progressive metalcore
Progressive deathcore
Fusion metal


text:
Currency Displayed in
'Perfect' Agate Stripping Guide 10mm - Concave Foot Design
Each serial numbered Agate insert is unique one-of-a-kind!
WYSIWYG-'What You See Is What You Get' - You will receive the guide pictured
This product hasn't received any reviews yet. Be the first to review this product!
All prices are in USD.


text:
Decisions to get married and have children are only partly rational decisions for most.
Decisions to get married and have children are only partly rational decisions for most.
You cannot know in advance all the ramifications of these decisions which is as it should be for if you did you might not enter into either arrangement. Because the fate of our happiness and the perpetuation of the human race depended on it, the Lord left these decisions in the hands of the young and caused them to go a little crazy before making their decisions.
Definitions and Numbers
'Family' is defined by the Census Bureau as two or more persons related by birth, marriage, or adoption residing in the same housing unit. [If cohabitating, they're a 'household.']
'Related' means their activities, outcomes, and fates are connected and, hopefully, concordant, or harmonious. I would add that the real basis of unity is not a legal agreement but love, and when it breaks down, a family becomes merely a household.
We have 76 million families of whom 55 million are married-couple households, 5.5 million households headed by single males, and 15 million headed by single females. The rest live in 40 million non-family households. Average family size is 3.25 and declining as the number of children per family declines below the replacement ratio of 2.1. If it weren't for illegal immigrants of high fecundity our national population would be declining.
Women are marrying later and the proportion choosing to remain childless has been increasing at an astonishing rate. Our birthrate is the lowest in recorded American history.
Twenty percent of women never bear children. One such woman described motherhood as "The hardest job in the world;" another said, "I love children. I just don't need to own one;" and a third said, "It takes all of you, and I don't know that I want to give it all."
The more intelligent women are, the less likely they are to become mothers. But, other groups are catching up. The typical four stages of adulthood are college, career, house, and kids but the economy and women's liberation have extended women's years in college and work which provided them a lifestyle without children that they don't want to give up.[1]
A child born last year will cost an average middle-income couple $241,000 to raise to the age of 18—NOT counting the cost of college. As a result of the State reducing appropriations and public universities over-compensating with tuition increases, college has been priced out of the budget of the average working-class family.
Child care averages 30 percent of a woman's income which causes some women to opt for stay-at-home mom-hood. After several years of that, some have lost their employability. Two-thirds of mothers in the work force have children under 18, and 40 percent of wives are their family's primary bread winner. Seventy studies have found maternal employment has not had a bad effect on the intellectual achievement of children and actually lowers the risk of divorce. [2]
Single Parenting
Everything bad that happens to children is worse in single-mother homes and anything to the contrary is a self-serving rationale and myth. Children need daddies. Period.
Buying a typical existing home here costing $193,000 is hard on one income given the requirement of a credit score of 650, 10 percent down payment [$19,300,] and monthly payments of $1,240 for 30 years. Remember, families choose jobs and unconscionable commutes to secure homes in school districts sought for their children. Everything about single-parenting condemns most children to the same economic status in life as their parents—the basis of charges that our society is devolving from class to caste. [3] The American Dream of children doing better than their parents is being sacrificed at the altar of life without Father.
American Values
Individuals are in the midst of a tectonic shift in values and practices in four areas of their personal behaviors and beliefs which in the aggregate are endangering the nation's strength and future. Sex outside of marriage, cohabitating, children born out of wedlock, and single-parenting are common and tolerated as different rather than judged to be wrong or even undesirable.
Far worse, we are changing the basis of our value judgments from the Bible to peer norms and public opinion polls. Legal now trumps moral. We have moral standards by majority rule. Fixed standards are out, replaced by situational ethics and moral relativism. We are in a moral whiteout without a polar star or moral compass.
[1] "The Childfree Life," TIME, August 12, 2013. "How Long Can You Wait To Have A Baby?," Jean Twenge, The Atlantic, July/August 2013.
[2] Stephanie Coontz, "The Trium p of the Working Mother," NYT, June 2, 2013; NYT, Dec. 1, 2013.
[3] Charles Murray, Coming Apart, NY: Crown Forum, 2012.


text:
Environment and Agriculture Graduate Schools are facing today's growing concern for eco-friendly business models that take people, planet and profit in mind.
Whether you want to learn more about social sustainability, food studies or agricultural science, a campus program is often a great way to go. These often infuse course content with regional issues to bring the classroom to life.
Environment and Agriculture Graduate Schools offer programs that could lead to a masters or doctorate degree. Non-degree certificates, which are available at some universities could enable one to study at the graduate level without the same commitment of a full degree program.
Under the umbrella of these graduate programs in environment and agriculture, there are a wide array of degrees and courses. Two of the broad categories to know about are:
(1) agriculture graduate programs
(2) green and sustainable energy programs.
Within these areas, students could find several options that have management-focused course lists. Either way, sustainable agriculture schools could provide an integrative education and experience which may factor in the natural, economic and social sciences.
Apart from advanced courses, graduate studies often entail some independent research, lab work, and/or internships. Plus, some food studies graduate programs are offered on campus where students may have access to organic gardens.
Together, these elements aim to prepare graduates to meet the challenges and opportunities in the multiple facets of modern agricultural, environmental, and sustainability science disciplines.
There are a variety of different Masters in agriculture, sustainability and environment. At this level of study, students may be exposed to a series of compulsory courses along with research methods and a choice of emphasis (track) on which to focus their studies.
Many Masters in Agriculture programs entail about 36 credits. Full-time students may be able to complete their program in about 2 years.
The standard educational prerequisite for applying to a Masters in Agriculture programs is a Bachelors degree from an accredited academic institution. Some schools may want to see a minimum GPA, but the bar is different everywhere. Look for a range from 3 to 3.3.
Applicants might also need to furnish transcripts, letters of recommendation, an essay, a resume and a completed application form.
Sustainability professionals seek to improve an organization's environmental, social, and economic impact. i
A Master of Sustainability could be a perfect option if your goal is to explore how eco-friendly systems relate to ecological, economic, social, and business spheres. For even more management courses, some students might pursue a joint MSUS/MBA degree.
Curriculums could start students off with a basic set of skills for work and research courses stacked onto foundational principles and current 'hot topics'. Concerns might include climate change, energy consumption, water pollution, urban ecosystems, children's environmental health, and agro-ecosystems.
To this point, some schools might use case studies based on local sustainability models. Chatham, a partner school, may offer a course that discusses the 'green renaissance' in Pittsburgh as an example.
From there, students might harness their strengths through electives and/or a concentration. Below is a brief synopsis of 5 of the dynamic areas that may be available. Refer to individual environment and agriculture graduate schools for more details and choices.
A Master of Science in Agriculture could include coursework in research methods, statistics, and all major disciplines in agriculture. Some universities might also offer an option designed for students who want to pursue teacher certification in Agricultural Sciences and Technology.
Sustainable agriculture graduate programs may have a somewhat different focus. For instance, a MS in Sustainable Agriculture and Food Systems curriculum might approach modern farming techniques with an eye to reduce negative environmental impact. See below for sample topics.
There are many singular themes that might be addressed in environment and agriculture graduate certificate programs. Certificates are often structured for the working professional who wants a knowledge infusion and new credentials. With fewer courses (e.g. 12 credits), students may be able to complete requirements in about one year of full-time enrollment.
A Graduate Certificate in Sustainable Practices program addresses the current field of sustainable design, engineering and construction of the built environment. Participants enrolled in this type of program might be exposed to a wide array of critical skills.
Environment and Agriculture PhD programs curriculums are often both deep and broad to enable participants to expand their knowledge base and/or study modern methods of conservation.
Sometimes, between the core and dissertation courses, participants may need to complete about 96 credits. Frequently, students are exposed to quantitative and qualitative research methods along with literature review, writing courses and lastly, independent inquiry. For some programs, most grad schools require applicants to have a relevant Masters degree, though there are certainly exceptions.
A Doctor of Management is the highest academic award for management students. Course lists tend to reflect this with compulsory topics.
Students might also learn about consulting and intervention, organization innovation, and scenario thinking in the required core. As well, research methods, bibliography and writing courses are there to provide guidance for students to conduct their own research project.
For the focus in Environmental and Social Sustainability, DM students could acquire the focused knowledge to guide organizational policy and action in a direction that shows concern for resources and revenue.
Graduates might therefore take away the ability to think systematically about current environmental issues. They may also gain insight into how to develop policies for their enterprise that reflect eco-positive models
In addition to the successful completion of all credit hours with an acceptable GPA, students must also satisfactorily complete and defend their research with a dissertation. Often, DM students use this research to problem solve within their technical area of expertise.
A Doctor of Business Administration, like the DM is a practice doctorate. Participants might study to learn how to apply current business practices to the management of businesses.
Most DBA programs start students with core courses that are tailored to this goal. These are often the topics that relate to business analytics, leadership, supply chain, marketing and intellectual property. For a 'global' business theme, courses might be taught from the standpoint of international and multinational practices.
Also, for a focus in sustainable management, DBA students could develop in-depth knowledge through targeted courses, such as:
To round out their studies, participants may have the freedom to customize electives from management, international business and entrepreneurship. Dissertation courses and final work could be similar to the DM degree.
Easily find Environment and Agriculture Graduate Schools that offer the perfect degree for you. Set location preferences and degree level, then get matched with our free service.
[i] bls.gov/green/sustainability/sustainability.htm#issues
Sponsored Listings
Brigham Young University
Utah State University
Sponsored Listings


text:
About the DRBA
Director's Message/Mission
Management Team
Meeting Information
Archived Resolutions
Financial Information
RV and Camper E-ZPass Alert
Working with the DRBA
Current Solicitations
Vendor Registration
Vendor Login
Supplier Diversity Program
DRBA DBE Program
Building for the Future
Capital Program Overview
Capital Program by Facility
Economic Development
Development Opportunities
DRBA's Role
Government Links
Community Newsletter
View Article
Current Articles
Cape May – Lewes Ferry Selects New Captains; Two Veteran Marine Employees Promoted
By JSalmon on 02/25/2013:
Cape May – Lewes Ferry Selects New Captains
Two Veteran Marine Employees Promoted
(Cape May, NJ) Today, Cape May – Lewes Ferry officials announced that Stan Hansen of Lower Township, New Jersey and Peter Dudley of Cape May, New Jersey were promoted to the rank of Captain effective Sunday, February 24, 2013. Captain Hansen and Captain Dudley report to Port Captain Bryan Helm.
"I'm honored that the Delaware River and Bay Authority selected me to be one of four Captains at the Cape May – Lewes Ferry," said Stan Hansen who was hired as an Able-bodied Seaman at the Ferry in 1988. "I love the water and I take pride in providing the best possible service to our customers. I'm really excited with this tremendous opportunity."
Prior to joining the Cape May – Lewes Ferry, Hansen worked in the area's commercial fishing industry for fourteen years. During this time period, he also owned and operated five different successful commercial fishing vessels from 1979-1989. Hansen joined the Cape May – Lewes Ferry operation in 1988 and was promoted to permanent Mate ten years later.
Dudley, who was recognized by the U.S. Coast Guard for the rescue of two sailors afloat on the Delaware Bay in 2006, echoed the sentiment of his colleague, Captain Hansen. "I appreciate and welcome the chance to serve as a Captain aboard the Cape May – Lewes Ferry vessels," Dudley said. "I really enjoy my work and I couldn't ask for a better job!"
A veteran of the Vietnam War, Dudley served as a Sergeant in the United States Army from 1966-1968. Following two years of service with Bay Ship Management, Dudley was hired as an Able-bodied Seaman at the Cape May – Lewes Ferry in 1995. Dudley has more than 40 years of maritime experience.
"Captains are the central figures in the maritime industry and crew members respect and adhere to that chain of command," said Scott Green, Executive Director of the Authority. "At the Ferry, our captains lead the entire organization by example and seek to exceed our customers' expectations every day. Peter and Stan fit that leadership mold."
"Stan and Peter are well-respected marine professionals who know the Delaware Bay inside and out," remarked Bryan Helm, Port Captain for the Cape May – Lewes Ferry. "They are proven, successful leaders, possessing outstanding ship handling and navigational talents as well as strong interpersonal skills. Both men are a credit to the maritime profession and we're fortunate to have them as part of our team."
As the manager and leader of a marine operations crew, the Captain has full responsibility for the safe and efficient operation of the vessel and the safety of passengers and crew. He is also responsible for compliance with all regulations applicable to the interstate marine transportation of vehicles and passengers. Both Mr. Dudley and Mr. Hansen possess a United States Coast Guard Inland Masters License of unlimited tonnage, an unlimited radar license, and an FCC Marine Radio Operators license. These men have undergone numerous USCG exams and have spent many years at sea to achieve the level of Master.
About the Cape May-Lewes Ferry
The Cape May – Lewes Ferry is owned and operated by the Delaware River and Bay Authority, a bi-state governmental agency created by Compact in 1962. The Ferry is open year-round and has carried more than 40 million passengers since its inception on July 1, 1964. In 2012, the ferry service, which connects Victorian Cape May, New Jersey, and historic Lewes, Delaware, transported approximately 275,000 vehicles and nearly 1 million passengers. For schedule, rates and other program information, please visit the ferry's website at www.CMLF.com, or call toll free, 800-643-3779.
Photo Captions:
Authority Executive Director Scott Green, who is pictured with Director of Ferry Operations Heath Gehrke, affixes the captain shoulder board to the uniform of Stan Hansen. Captain Hansen is one of four permanent Captains at the Cape May – Lewes Ferry.
Authority Executive Director Scott Green attaches the captain should board to the uniform of Peter Dudley. Captain Dudley, pictured next to Heath Gehrke, Director of Ferry Operations, has more than forty years of maritime experience.
Director of Ferry Operations Heath Gehrke (far left) joins with Authority Executive Director Scott Green (far right) to congratulate new Captains at the Cape May – Lewes Ferry, Stan Hansen and Peter Dudley.
Terms Of Use
Privacy Statement
©2018 Delaware River & Bay Authority. ALL RIGHTS RESERVED.
Site design by Tipton Communications


text:
Test the survey below to experience QuestionPro
Thank you for completing the survey.
A $5 Starbucks card has been emailed to you!
Thank you for completing the survey.
A $5 Starbucks card has been emailed to you!
Powered by
Join over
2 million customers
Quickly create online surveys and polls with our intuitive web based software tool. You can create your own survey, copy a professionally written survey template, or upload your survey directly from a Word file. With over 30 question types and dozens of color themes, QuestionPro makes it easy to create great looking questionnaires and surveys.
Reach your customers wherever they are using our survey tools: email system, embedding in your website, creating pop-up and exit surveys, or posting to social networks like Facebook, Twitter, or Google+. QuestionPro surveys look great on mobile devices or tablets, and you can even collect responses offline using our iOS and Android mobile survey app.
We make analysis easy with a full set of reporting features such as real-time summary, pivot tables, segmentation tools, trend analysis, and text analytics. You can also export your survey data directly to Excel, SPSS, or CSV. We make it easy to share results with formatted Word and PowerPoint reports or by generating great looking infographics.
Powered by
Utilize QuestionPro's database of millions of highly qualified respondents for your next research project. Our experts are standing by to offer turnkey management and support for all your sample needs.
A flexible solution for academic institutions which gives every student unlimited access to QuestionPro's highest paid license. For more in-depth analysis, a Research Team license offers advanced collaboration as well as custom scripting.
QuestionPro's seamless data integration with Salesforce and robust API put you in complete control of your data. Export data & reports to SPSS, Google Docs, Adobe PDF, Microsoft Excel, Word & PowerPoint.
Security is the highest priority. QuestionPro is SSAE 16 (SOC 2) compliant, audited by a third party; and EU and Swiss SafeHarbor certified. SSL for survey and data is standard, and SSO is available.
Creating a survey with QuestionPro is optimized for use on larger screens -
Though you're welcome to continue on your mobile screen, we'd suggest a desktop or notebook experience for optimal results.Back to QuestionPro.com Continue to Login


text:
Twins Swept In Tampa Thursday
The Twins lost for the eleventh time in twelve games Thursday with a 4-3 loss to the Tampa Bay Rays at Tropicana Field. The Rays swept the four game set with Minnesota.
The Twins only managed four hits in the game against All Star Matt Moore, including a two-run bloop double from Joe Mauer in the eighth inning. Moore improved to 13-3 with the win, which was the eighth straight for Tampa Bay.
The Twins schedule does not get any easier as they open a three game series with the New York Yankees in the Bronx Friday night. Minnesota manager Ron Gardenhire has a career record of 21-59 against the Yankees.


text:
Setup your preferences to see how this location matches your needs
Overall Match
LS2 9NQ is within Leeds Local Government District and within the Metropolitan District of West Yorkshire. LS2 9NQ also falls within Leeds Central Westminster Constituency and Leeds Travel to Work Area.
Properties for sale near
Useful links for
More Details
Property Match
More Details
Schools Match
More Details
Crime Match
More Details
Travel Match
More Details
Environment Match
Local Info
More Details
Local Council
Local Jobs
The headline information on Property, Housing, Crime, Schools Performance, Travel & Environment is based on data for an area in and around LS2 9NQ. Our help pages provide details of how data is collated for each category.