Jump to content

imnewtophp

New Members
  • Posts

    5
  • Joined

  • Last visited

imnewtophp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, Got it working. <?php // The file $src = 'http://s2.evcdn.com/images/block250/I0-001/004/166/985-0.jpeg_/tiffany-alvord-85.jpeg'; $percent = 0.5; header('Content-Type: image/jpeg'); list($width, $height) = getimagesize($src); $new_width = 186; $new_height = 146; $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($src); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $dest = imagecreatefrompng('polastraight.png'); imagealphablending($dest, false); imagesavealpha($dest, true); imagecopymerge($dest, $image_p, 40, 38.5, 0, 0, 186, 146, 100); header('Content-Type: image/png'); imagepng($dest); imagedestroy($dest); imagedestroy($src); ?>
  2. I saw that code from searching earlier. Which part exactly do I need to use. I am not uploading the pictures they are already uploaded. I have tried your suggestion $src = imagecopyresampled(50,50); It doesn't work.. it does the following: http://pennybeta2.webege.com/merge.php Thanks for your help guys.
  3. I have a page that merges two pictures into one using the code below. I am trying to rezise the $src image. At the minute the last two numbers in imagecopymerg resizes what is displayed but it shows only part of the image and doesn't resize the image, for example it would show the top corner of the image. <?php $dest = imagecreatefrompng('polayoloright.png'); $src = imagecreatefromjpeg('tiffany_alvord_heart_2bg9s7p.sized.jpg'); imagealphablending($dest, false); imagesavealpha($dest, true); $src = imagecreatetruecolor(50,50); imagecopymerge($dest, $src, 1, 1, 0, 20, 50, 50, 100); header('Content-Type: image/png'); imagepng($dest); imagedestroy($dest); imagedestroy($src); ?> I have tried adding the following. It resizes it but displays a black box, not the image. $src = imagecreatetruecolor(50,50); Any ideas? Thanks
  4. It was as simple as I thought. However, when testing it I was trying to upload pictures that had spaces in the filename. I guess this is a different problem. It works fine with a normal file name.
  5. I have created a member system that saves the user data into a mysql table. I am now trying to allow users to upload a picture. I have found the following code that works. However I want to use it within the code I have already. When I try and remove the 'if' function it no longer works. What do I need to remove/add to just have it upload the image to my host and not echo anything back? <?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.