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
1
vote
1 answer

How to add WP variables to GD imagepng

I'm trying to add a logged in user ID (wordpress) to a GD image. When I use a constant it displays the png correctly, when calling a variable it shows a broken image link. The call is done through a shortcode calling: /* ================== GET PIC…
Duttch
  • 21
  • 3
1
vote
1 answer

Error while resizing image upload with Laravel Image Intervention

I am using Laravel Image Intervention to resize an image upload field on my form. This is the error I receive on upload - I am running on Valet. Command (Extension) is not available for driver (Gd). The following works fine without Image::make …
scopeak
  • 545
  • 1
  • 5
  • 22
1
vote
0 answers

Random line generation in an image in PHP

Good day, We are trying to generate these lines in an image in php. Image with random lines But we haven't close enough like this one. Is there anything you can suggest to generate this kind of image via PHP? Thank you. PS. We used PHP GD…
1
vote
2 answers

How can I draw a flipped image and original image side by side in PHP?

Here is the code that I am using currently. $image = imagecreatetruecolor(400, 300); imagesavealpha($image, true); imagesetthickness($image, 2); $red = imagecolorallocate($image, 255, 0, 0); $green = imagecolorallocate($image, 0, 255, 0); $blue =…
iKnowNothing
  • 175
  • 11
1
vote
3 answers

How to store php imagejpg() result in mysql database

I have resized the image that I received from the user using the below code: $imagedata = getimagesize($_FILES['uploadedimage']['tmp_name']); $newwidth = $imagedata['0']/3; $newheight = $imagedata['1']/3; $thumb…
1
vote
1 answer

How to correctly use of imagettftext?

I am making a form which the user is filling to create a mail signature: generatarjeta.php if(isset($_GET["suc"]) && $_GET["suc"] !="") { $code=""; foreach($_GET as $key => $value){ $code.= $key . "=" . $value . "&"; } $code =…
Neobugu
  • 333
  • 6
  • 15
1
vote
1 answer

How can I turn imagegif() into a variable?

I’m trying to get the contents of imagegif() to a variable, or save a gif in a variable. I guess I could do a temporary file and file_get_contents(), but I’m searching for a simpler method. I don’t use Imagemagick, I use GD.
Vixxs
  • 569
  • 7
  • 21
1
vote
1 answer

Fedora25 Php 5.6 gd soap Mysql 5.x and PhpMyAdmin

I am new to linux. I have successfully installed following modules on Centos7 but I have problem with Fedora25. I have checked google etc but theres only instructions for Fedora24. I am amble to install php7 or php5.6 from remi repo but I cant find…
mr R
  • 997
  • 2
  • 12
  • 25
1
vote
1 answer

Install php5.6-gd on ubuntu 14.04 but php is not recognizing it

I have php version 5.6.22. Install php5.6-gd on ubuntu 14.04 but php is not recognizing it. I have installed php5.6-gd by following below steps. sudo apt-get update sudo apt-get install php5.6-gd Added extension=gd.so in php.ini file. But still…
amol rajhans
  • 23
  • 3
  • 3
1
vote
1 answer

How to cache dynamically created images?

I have a php script that generates *.png pictures but does not store them on the server. Those pictures will be shown to a same user repeatedly. I'm looking for a way to cache those pictures. I'm able to send the 304 status header, the browser also…
Faegy
  • 942
  • 1
  • 12
  • 29
1
vote
1 answer

PHP Add text to image and save

I am attempting to have a PHP file add an ID to an uploaded image and resave the image. For some reason the code below is not working even though it looks very similar to other examples I have found online. What am I doing wrong? …
Nate23VT
  • 423
  • 8
  • 27
1
vote
0 answers

PHP GD function not working properly

I am passing an image through 2 functions: a(), an image resizer function & b(), an image color bit function. After b() is done I'm passing it back to a(), yet after b() handled the image, I am no longer getting any returned value from a() anymore,…
clusterBuddy
  • 1,523
  • 12
  • 39
1
vote
1 answer

PHP5-GD in Debian Testing missing Dependency libvpx1

I run Debian Testing on my dev Server. Unfortunatley I have to work with mysqli (which is not included in php7) and php-gd at the same time. cat /etc/issue Debian GNU/Linux stretch/sid apt-get install php5-gd Reading package lists... Done Building…
Paflow
  • 2,030
  • 3
  • 30
  • 50
1
vote
2 answers

PHP: transparency not respected when copying PNG onto another PNG

I'm having a rough time getting this transparent PNG (map marker) to be transparent being copied onto the larger PNG (radar image). I've tried a number of different things and all have failed. It must be something quirky because if I use a…
Handler
  • 57
  • 7
1
vote
1 answer

Upload imagecreatefrompng to server

I am trying to upload an image created from Java's toDataURL, submitted in a form automatically with javascript, captured by PHP and converted using imagecreatefrompng() and assigned to a variable. Here is the code to start with: Javascript…