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-gd installed but fails to function in centos 7 (php 7.3 version)

I am trying to install moodle but it shows php-gd extension is missing/should be enabled. However the gd is already installed and latest, and when I command php -v I get the following error as indicated below. PHP Warning: PHP Startup: Unable to…
Jeff Seven
  • 21
  • 1
  • 3
2
votes
1 answer

Multiple degree color in PHP GD

I'm trying to make a degree color image in the PHP GD library. I just made a simple code that works fine with 2 colors, but, if I put more than 2, it makes something strange. My code: function gradientfilledrectangle ( $image, $x1, $y1, $x2, $y2,…
El Tito Barte
  • 277
  • 2
  • 13
2
votes
1 answer

Converting webp to jpeg in with PHP GD Library

I'm having some trouble creating a clean looking image transcode from webp to jpeg using PHP's GD library. As a point of reference Here is a jpeg version of the original using Google's demo here: https://developers.google.com/speed/webp/gallery (I'm…
2
votes
1 answer

Combine different length GIFs

I am trying to combine variable length PNG strips into a single GIF using the PHP GD and imagemagick libraries. For example: = 4 frames = 8 frames = 9 frames = 12 frames = 36 frames When combining these into one GIF there has to be enough…
Daniel
  • 1,229
  • 14
  • 24
2
votes
4 answers

GD Library extension is not available with this PHP installation

Please help, I have CentOS7 on my server as well as Laravel Project with php 7.3. On CentOS I have httpd and mariadb installed. When uploading the avatar, I receive the following error: Intervention \ Image \ Exception \ NotSupportedException GD…
2
votes
1 answer

Fill png transparency with background color

I'm refactoring an old image crop/resize library i wrote about 5 years ago and i'm stuck trying to restore one of it's functionalities. The funny part is that i'm not even sure it worked back then since i probably never actually used it. I need to…
Magnesium
  • 597
  • 6
  • 22
2
votes
0 answers

PHP - Internal Server Error using php-gd

When I use some function like imagecreate() or imagecreatefromjpeg() the result that I get is an internal server error. The code is the following: The version I'm using…
aroabarberan
  • 157
  • 1
  • 2
  • 10
2
votes
0 answers

Don't show processed GD PHP image in browser

this is my first question and I'm planning to hang around in this forum. I'm very new to programming since I'm studying but I'm making great progress. So, with this in mind I'll try to be as detailed as possible. The project I am working with is…
Daniel
  • 71
  • 4
2
votes
0 answers

imagecreatefromjpeg got gd-jpeg: JPEG library reports unrecoverable error: Bogus Huffman table definition

I have migrated from a shared hosting with apache and Prestashop, to a debian 9 VPS server, i got problems with images like those So in Prestashop image back end page, i tried to regenerate the shop images so i got this error: imagecreatefromjpeg…
Tarek Fellah
  • 179
  • 3
  • 4
  • 18
2
votes
2 answers

Fill transparent part of image with pattern image in PHP

I am trying to apply pattern on a transparent image with GD library. I have an inverse transparent image and a couple of pattern images to apply on placeholder. Any suggestion how to achieve this using GD library or image magic.
Abuzer Firdousi
  • 1,552
  • 1
  • 10
  • 25
2
votes
1 answer

How to put a PHP gd created image into a canvas over the top of an existing image

I am trying to create a feature on a website that allows a user to upload a pngimage using javascript and then over the top of that place a new pngimage using PHP gd that has transparent circles so that the image underneath will show though. I will…
Moff
  • 23
  • 1
  • 5
2
votes
1 answer

base64_encode() method used on a GD image(imagecreatefrompng) outputs differently on local host and remote host

This is the code I use to generate the base64 image. it works perfectly on local host but, however it generates a different output on a remote host.
2
votes
1 answer

PHP GD creating image using a function

I don't understand why one of the lines is not being drawn in the following code:
pi.314
  • 622
  • 5
  • 16
2
votes
1 answer

PHP-GD Transparency of watermark PNG not correctly merged with JPEG

I am trying to install a watermark in the middle of my image, but every time it shows a weird square which is not fully transparent. This is the result of my code: This is my code:
2
votes
1 answer

How efficient is a PHP image resource?

I have a very large PNG image, and I am writing a method to get the value for a color at a specific (but changing) pixel of that image. When I create the image using: $image = imagecreatefrompng('map.png'); Is the whole image loaded into memory…
BadPirate
  • 25,802
  • 10
  • 92
  • 123