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 do I compile PHP with freetype support on Ubuntu 20.04

On calling the function imagettfbbox(), I'm getting the error Fatal error: Uncaught Exception: Function "imagettfbbox" does not exist: check your FreeType installation in... I understand from many sources, including other stackoverflow questions…
user1729972
  • 712
  • 2
  • 9
  • 29
1
vote
0 answers

php extension gd not working php7.4.21 (Parrot Os)

I have search all over the internet just to find a solution for this problem. I have php7.4 installed on my system. I have been struggling with the php-gd extension. I have been able to install the extension and yet when i try to run any php…
1
vote
0 answers

PHP-GD installed but required during the wordpress installation

I try to install Wordpress using Virtualmin manager. During the installation the manager return: Error: Unable to find a match: php74-gd after command: /bin/dnf -y install php74-gd I have PHP 7.4 and see module gd in modules list. Anyone know what…
nsc
  • 107
  • 1
  • 7
1
vote
0 answers

Wrong transparent backgrund with PHP-GD

I've got a problem with php-gd, I use php-gd to resize png with transparent background file. after that, I put the resized png with and set a background color #wheat on HTML file. But the background color is not pure wheat, there is 'brushed…
evenloooo
  • 77
  • 1
  • 10
1
vote
2 answers

How to install ext-gd for php7.4 at scrutinizer-ci config?

After some point, Scrutinizer started permanently failing when trying to analyse Sylius plugins code with next errors: - sylius/sylius v1.7.3 requires ext-gd * -> the requested PHP extension gd is missing from your system. - sylius/sylius v1.7.2…
igormukhingmailcom
  • 465
  • 1
  • 6
  • 9
1
vote
1 answer

PHP : imagegrabscreen() not working on PHP 7.2.27

I am using 7.2.27 PHP version with Laravel 7. Below code working on my local same configuration, $captured = imagegrabscreen(); imagepng($captured, "~path/" . time() . ".png"); imagedestroy($captured); But this code not working on live server it's…
Jaydeep Mor
  • 1,690
  • 3
  • 21
  • 39
1
vote
1 answer

Unable to locate package php gd Heroku

I'm trying to deploy my project with Heroku and I need to install gd on my server. My composer file structure looks "require": { "ext-gd": "*", } When I making composer update i catch the following message. The requested PHP extension…
1
vote
1 answer

Use font file from S3 bucket with php gd

I am using the PHP GD library for image processing in my Laravel Application. My application is deployed on AWS Lamda. I am trying to use custom fonts in GD Library. The function imagettftext specifically asks for the file path. Since I am on AWS…
Vikas Roy
  • 854
  • 2
  • 10
  • 25
1
vote
2 answers

Imagecreatefromjpeg returns false even if image is exists

This code returns false: $image = imagecreatefromjpeg("photos/profiles/original/4cdf149b63d0ca0158f68357d8da371c_y.jpg"); var_dump($image); exit; But this code: $image =…
Tolgay Toklar
  • 4,151
  • 8
  • 43
  • 73
1
vote
0 answers

Unable to install PHP-GD for Php 7.3 on Ubuntu

I have tried every command here: sudo apt-get install php7.0-gd sudo apt-get install php7.1-gd sudo apt-get install php7.2-gd sudo apt-get install php7.3-gd None of them exist. Adding this repo, add-apt-repository ppa:ondrej/php Dos not solve…
Roddy P. Carbonell
  • 858
  • 1
  • 11
  • 16
1
vote
3 answers

Colorize PNG using PHP GD

I want to colorize some PNGs using PHP GD. For testing purpose i hardcoded the color red (255,0,0) which later will be replace by a dynamic variable. For example i have these two images: Image 1: Image 2: Using my code, only image 2 works as it…
user5629061
1
vote
1 answer

php7.2-gd can't find package (tried everything)

I have Ubuntu 14.04 and php7.2 but can't install php7.2-gd I need to install package php7.2-g when i run apt-get install php7.2-gd it says that: E: Unable to locate package php7.2-gd E: Couldn't find any package by regex 'php7.2-gd' I added…
ildar
  • 185
  • 2
  • 3
  • 16
1
vote
0 answers

Resizing images via nginx imagefilter vs php gd. Which is better?

I want to know which will consume more cpu resources? Resizing and serving image live via image_filter module in Nginx Or Resizing and serving images live via PHPGD in PHP Script Since both use GD Library which approach should I use? How much is the…
Future King
  • 3,819
  • 6
  • 28
  • 37
1
vote
0 answers

How to add a transparent rectangle to PNG file in php WITHOUT a border

I can successfully add a transparent rectangle to an area of a saved PNG file, but it has a faint border around it, which can be seen on the final image. I want to remove this. The code I use to add the rectangle…
haverer
  • 21
  • 3
1
vote
1 answer

PHP Image: generated image has right and bottom black border on production server, but not on my local machine

This app is written by me, I've tested it on my local machine, and the image generated by my app is great without bug on my local development server machine. My app is an API, the user use it to generate tiled image. It mostly uses PHP Image GD…
Rizki Pratama
  • 551
  • 4
  • 23