BMP to JPEG

http://www.phpro.org/examples/Convert-BMP-to-JPG.html

add watermark in PHP

<?php
/**
* Put logo on low right jpeg image
* used stefan’s script for position
**/
$logo_file = “watermark.png”;
$image_file = “img.jpg”;
$targetfile = “img3.jpg”;
$photo = imagecreatefromjpeg($image_file);
$fotoW = imagesx($photo);
$fotoH = imagesy($photo);
$logoImage = imagecreatefrompng($logo_file);
$logoW = imagesx($logoImage);
$logoH = imagesy($logoImage);
$photoFrame = imagecreatetruecolor($fotoW,$fotoH);
$dest_x = $fotoW – $logoW;
$dest_y = $fotoH – $logoH;
imagecopyresampled($photoFrame, $photo, 0, 0, 0, 0, $fotoW, $fotoH, $fotoW, $fotoH);
imagecopy($photoFrame, $logoImage, $dest_x, $dest_y, 0, 0, $logoW, $logoH);
imagejpeg($photoFrame, $targetfile);
echo ‘<img src=”‘.$targetfile.’” />’;
?>

Follow

Get every new post delivered to your Inbox.