gd

How do I add text to curved image?

$config['source_image'] = '/path/to/image/mypic.jpg'; $config['wm_text'] = 'Copyright 2006 - John Doe'; $config['wm_type'] = 'text'; $config['wm_font_path'] = './system/fonts/texb.ttf'; $config['wm_font_size'] = '16'; $config['wm_font_color'] = 'ffffff'; $config['wm_vrt_alignment'] = 'bottom'; $config['wm_hor_alignment'] = 'center'; $con...

Saving a remote image with cURL?

Morning all, Theres a few questions around this but none that really answer my question, as far as I ca understand. Basically I have a GD script that deals with resizing and caching images on our server, but I need to do the same with images stored on a remote server. So, I'm wanting to save the image locally, then resize and display ...

curved text in php

Hi, i am need of watermark an image with curved text. i had gone through some sites in internet, but i couldn't find the code which i need. somebody please tell me how to generate curved text in php thanks and regards tismon ...

Problem with php GD image not creating

With the following code, my browser is returning 'image not created or saved'. I assure you the location of the image exists. So the line within the if statement is returning false for some reason, and yes GD is installed. Any ideas? if ($img = @imagecreatefromjpeg("/var/www/images/upload/1/1.jpg")) { die("image was creat...

Using the filename for GET data and making the PHP page output as a JPG extension?

Alright, currently I'm using GD to create a PNG image that logs a few different things, depending on the GET data, for example: http://example.com/file.php?do=this will log one thing while http://example.com/file.php?do=that will log another thing. However, I'd like to do it without GET data, so instead http://example.com/dothis.php wil...

PHP GD - How can I modify my Thumbnail Creator to crop portrait images from the center?

Here is my current code: $image = 'img.jpg'; $source = imagecreatefromjpeg($image); list($origWidth, $origHeight) = getimagesize($image); $imgH = 75; $imgW = $origWidth / $origHeight * $imgH; $thumb = imagecreatetruecolor($imgW, $imgH); imagecopyresampled($thumb, $source, 0, 0, 0, 0, $imgW, $imgH, $origWidth, $origHeight); Th...

Trying to generate proportionally cropped thumbnails at a fixed width/height with PHP GD

I'm trying to create a Thumbnail Generator in PHP with GD that will take an image and reduce it to a fixed width/height. The square it takes from the original image (based on my fixed width/height) will come from the center of the image to give a proportionally correct thumbnail. I'll try to demonstrate that confusing sentence with some...

How can I overlay a watermark on an already resampled image in PHP (using GD) ?

Here's my current code: define('IMG_WIDTH', (isset ($_GET['width'])) ? (int) $_GET['width'] : 99); define('IMG_HEIGHT', (isset ($_GET['height'])) ? (int) $_GET['height'] : 75); $image = imagecreatefromjpeg($_GET['image']); $origWidth = imagesx($image); $origHeight = imagesy($image); $croppedThumb = imagecreatetruecolor(IMG_WI...

I need some help cropping an image in PHP (GD)

http://i.imgur.com/foT9u.jpg Using that image as an example, here's what I need to do: Crop the blue square to have the same proportional ratio as that of the black square From doing that, I should then be able to resize the blue square to fit into the black square without stretching it - It'll retain its proportions. Note: The blue...

How do I get rid of the pie chart outline in Perl's GD::Graph?

I am trying to create a pie chart with no outline using GD::Graph. Frustratingly I can control the colour of the outline with this: accentclr => 'black', So I would expect that I could get rid of the outline completely by doing this: accentclr => undef, However, when I do this the outline does disappear but the rest of the ...

Create a picture with GD containing other images

Hi, I would like to create a picture in PHP with GD composed by different other pictures. For example I have 6 pictures (or more) and I would like to create ONE picture who contain these different pictures. The Difficulty is that my final picture must have a fixed width and height (304x179), so if the different pictures are too big the...

PHP-GD: Is it possible to apply a filter to part of an image in one go?

I want to apply a pixelate filter to a rectangular part of an image. Is it possible to achieve this in one go, or should I make two images, apply the filter to the second and ... then what? ...

can I have multiline text with GD and PHP?

hello! I'm trying to output multiline text with GD+PHP but can't get it working. my php knowledge is really basic. here's the code, any idea on how to output 2 or 3 lines of text? $theText = (isset($_GET['caption']))? stripslashes($_GET['caption']) :''; imagettftext($baseImage, $textSize, $textAngle, $textXposition, $textYposition, $te...

Use referrer info to get image from url

Hi I want to get image from another site but I requires referrer information to show image. image address is: http://www.foo.com/hist.gif?21918+201020 this adress show gif image if you came this page from foo.com Think I can do this with curl but I don't know how to do this. I have to show image with img tag ...

Create Dynamic Images using Base Image

I am creating a Google Maps Social Application.. I have a basic marker that has a blank square in between it where I need to put the user uploaded picture. I already have the user uploaded pictures. Now How do I create these dynamic markers using PHP.. The accepted pictures are jpeg and png. I have heard of the PHP GD Library and woul...

Image resizing not working with png images

it not work with png created a thumb png but haven't data , like null data :D with jpg , jpeg still working without error why ? function thumbnail($pathtoFile,$thumWidth,$pathtoThumb) { //infor of image $infor = pathinfo($pathtoFile); // Setting the resize parameters list($width, $height) = getimagesize($pathtoFile)...

How to include an image inside another image in PHP?

How to include an image inside another image in PHP? I want to do it like in twitterbackgrounds.com personalized backgroud. there is one main image and we can upload four personal images after that it will show as watermark of the main image. ...

How can I "flip" an image using PHP?

Possible Duplicate: How to resize an image using PHP? Here's what I've tried: $image = "images/20100609124341Chrysanthemum.jpg"; $degrees = 40; // Content type header('Content-type: image/jpeg'); // Load $source = imagecreatefromjpeg($filename); // Rotate $rotate = imagerotate($source, $degrees, 0); // Output imagejpeg...

how to show square root symbol in image using gd library

I'm using php and gd library to draw a triangle. I'm able to draw triangle and add text to it(using imagettftext). But now i'm stuck with a problem. The two sides of the triangle are 'x' and 'x+2'. So hypotenuse will be sqrt(x^2+(x+2)^2). But i dont know how to show this equation using proper mathematical(i mean using square root symbo...

Give border to image created in PHP

How do I give a border to an image created using PHP? ...