Questions tagged [php-gd]

The PHP GD class contains built in image manipulation for PHP versions 4.3 and up.

The PHP GD class contains built in image manipulation for versions 4.3 and up. This class is commonly used for:

  • Adding filters to images
  • Adding watermarks to images
  • Changing image size for upload
  • Outputting an image to the buffer
  • Creating images on the fly (e.g. captcha verification)

A download of the library can be found at https://bitbucket.org/pierrejoye/gd-libgd/downloads

370 questions
2
votes
2 answers

PHP Content-length header delays loading

I have a PHP webpage that takes a BLOB from a database and outputs it as an image. When the user uploaded this image I stored the filesize (e.g. 491099) into the database. When the image is requested through my webpage I add a watermark, set the…
Jules
  • 7,148
  • 6
  • 26
  • 50
2
votes
1 answer

Issue with creating an image with PHP GD `imagecreatefromstring` function

I have a simple service that generates a PNG image of any text, using the parameters passed via a URL. One of the parameters is the text itself, the rest are things like 'font', 'color', 'font weight' etc. An example of such a URL…
Andrei Oniga
  • 8,219
  • 15
  • 52
  • 89
2
votes
1 answer

read pixels from image and randomly show single pixels in browser with PHP

I have an image that is saved in a database. I need a script that can read the RGB + x and y value of each pixel of this image. This is needed because I want to be able to show random pixels of this image in a browser. With random I mean, random…
BF_12
  • 21
  • 2
2
votes
0 answers

php image popart

Is there any good script or library with php to make image into popart with two colors white and another color if not multiple . I am not able to find any example in GD or imagemagick
user1492502
  • 379
  • 2
  • 22
2
votes
3 answers

Ajax and returning image created by PHP GD

I have a PHP script that generates an image with PHP GD. After it generates the image, it saves it, and send this output when called by Ajax: imagejpeg($img_data, 'filename.jpg'); echo ''; And after that, the image is…
SomeoneS
  • 1,207
  • 2
  • 19
  • 34
2
votes
1 answer

generating transparent GIF images in php

I have a php script which dynamically generates thumbnail images of larger images without storing it on the web server. The problem is that when the image is a transparent GIF image the thumbnails generated are not transparent. It correctly…
rockstar
  • 1,322
  • 1
  • 20
  • 37
2
votes
2 answers

Error installing GD Toolkit

I have been trying to install the GD toolkit on my Ubuntu VM. The operation is simple enough: sudo apt-get install php5-gd However, when I run this, I get a 404 (Not Found error) for a package: Reading package lists... Done Building dependency…
lfboulanger
  • 2,140
  • 2
  • 17
  • 20
1
vote
1 answer

temporarily store remote images to server

copy('https://graph.facebook.com/$fbid/picture?type=large', 'images/$fbid.jpg'); i am using the above code to store the image locally .. the above code works without the variable. As it does not executes php in it so it is useless with links…
Ramanvir Sodhi
  • 161
  • 1
  • 9
1
vote
2 answers

Thumbnail Generation not working on server - PHP Gallery

This works perfectly fine on localhost but doesn't work on my server, could anyone tell me why? I've got php-gd (php-gd-5.1.6-32.el5.x86_64) on my Centos 5 box. I have absolutely no idea why it wouldn't be working on the server so, if anyone has any…
Hugo
  • 37
  • 1
  • 7
1
vote
0 answers

Can imagettfbbox use URL's?

The PHP manual page for imagettfbbox says: fontfile The name of the TrueType font file (can be a URL) but passing a URL gives a Unable to access error. I have a number of fonts on my Amazon S3 account, like …
1
vote
1 answer

create outline of polygon for GIF image

I'm using imagefilledpolygon to draw an arrow on a GIF image (PHP) and I'd like to make the arrowhead outlined in black. I first create a triangle for the arrow and then draw a thick line at the base of the triangle for the arrow effect. One…
themerlinproject
  • 3,542
  • 5
  • 37
  • 55
1
vote
1 answer

PHP generating PNG bar chart

I have a database with orders in and need to generate a PNG graph to show the total of orders placed every month. I can get this to work from a normal array, however I can't seem to get it to work from my database query. I think the code which needs…
Phil Young
  • 1,334
  • 3
  • 21
  • 43
1
vote
2 answers

What is the use case for imageantialias($img, false)

I don't understand why in PHP when using the imageantialias function you need to pass in a Bool to say if you want to enable anti-aliasing or not. It feels counter intuitive to call a function with a parameter to say don't do anything. Is there a…
Toby
  • 8,483
  • 13
  • 45
  • 68
1
vote
1 answer

PHP GD: Crop polygon: Works with some images, with some not

I want to crop out a polygon (that I have there a transparent area) of an image I saved from Google Maps Static API. Then I created a second image, saved it and tried also the same script on it but with the difference that the was no effect/change…
Poru
  • 8,254
  • 22
  • 65
  • 89
1
vote
1 answer

Rendering Image on PHP symfony 2

I'm trying to generate an image using php-gd but the output is only special characters. Did I use the "header('Content-Type: image/png')" correct? My Image Class: public function __construct(){ header('Content-Type: image/png'); $this->image…
dual inline
  • 13
  • 1
  • 3