Jump to content

Ishimoto

New Members
  • Posts

    2
  • Joined

  • Last visited

Ishimoto's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I'm trying to combine two images - an uploaded image and a permanent. First I try to resize them to the same dimensions. Why I resize the uploaded image to the dimensions of permanent, everything works fine. But when I do the opposite, the images just don't merge, and the output is just the permanent image with resized dimensions. Anyone knows why? Here is my code: <?php if( isset( $_FILES['image'] ) ){ $desired_width = 360; $desired_height = 360; $layers = array(); switch($_FILES['image']['type']){ case "image/jpeg": $source_image = imagecreatefromjpeg($_FILES['image']['tmp_name']); break; case "image/gif": $source_image = imagecreatefromgif($_FILES['image']['tmp_name']); break; case "image/png": $source_image = imagecreatefrompng($_FILES['image']['tmp_name']); break; } $frame = imagecreatefrompng("1.png"); $desired_width = imagesx($source_image); $desired_height = imagesy($source_image); $virtual_image = imagecreatetruecolor($desired_width, $desired_height); imagecopyresampled($virtual_image, $frame, 0, 0, 0, 0, $desired_width, $desired_height, 360, 360); $layers = array($source_image,$virtual_image); $image = imagecreatetruecolor($desired_width, $desired_height); // to make background transparent imagealphablending($image, false); $transparency = imagecolorallocatealpha($image, 0, 0, 0, 127); imagefill($image, 0, 0, $transparency); imagesavealpha($image, true); imagealphablending($image, true); for ($i = 0; $i < count($layers); $i++) { imagecopy($image, $layers[$i], 0, 0, 0, 0, $desired_width, $desired_height); } imagealphablending($image, false); imagesavealpha($image, true); header('Content-type: image/png'); header('Content-Disposition: attachment; filename="new_profile.png"'); imagepng($image); } ?>
  2. I've downloaded the PHP client library for Google Adwords API. I need to insert my login details in/src/Google/Api/Ads/AdWords/auth.ini. One of the variable is developerToken . It is said here: https://developers.google.com/adwords/api/docs/signingup that in order to get this variable, you need to log into the MCC, and Navigate to My Account -> AdWords API Center. But I don't see the link to "Adwords API Center" under "My Account". Can someone help me please to get the API access? Thanks in advance
×
×
  • 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.