Questions tagged [gd]
GD Library is used to dynamically create and manipulate image files.
2,922
questions
0
votes
0
answers
12
views
PHP Warning: Module "gd" is already loaded in Unknown on line 0 (CPanel)
I have PHP 8.0 running on a CENTOS server and using the latest version of CPanel.
The GD extension is installed according to the server data.
When I run this code:
<?php
var_dump(gd_info());
?>
...
0
votes
0
answers
12
views
How to enable GD support for everything in docker?
GD was a pretty simple installation in my local development (Fedora Linux), but it is giving me a bit of a headache setting it up in docker. Many of my app functionalities doesn't work because of GD ...
-1
votes
0
answers
27
views
Imagewebp function is not working - macos
enter image description here
imagewebp() function is not working, I tried most of the solutions found.
i have macos and xampp php version 8.0
0
votes
0
answers
37
views
GD Library extension not available with this PHP installation, windows
i'm using php 8.1.4, laravel v9, xampp v3.3.0
in php.ini file i've changed ;extension=gd to extension=gd, but it still show the same error
0
votes
1
answer
43
views
PHP GD no webp support in docker
I always used GD to manipulate webp normally in my local environment, but when attempting to test my scripts in docker environment, i get "Webp format is not supported by PHP installation." ...
0
votes
1
answer
32
views
Modify PDF to display multiple slide per page with PHP
I have a PDF, let's assume with 10 pages.
I search a script that will modify this PDF to display 4 slide per page (in fact, x slide per page).
So in the end, the output will be a PDF with 3 pages (...
0
votes
1
answer
14
views
How to rotate series of images with transparent backgrounds in PHP without imagerotate adding black?
I have a lot of images, exported from blender, that I want to rotate. They all come with a transparent background. An example, 0009.png:
This image is 70w x 70h.
I'm trying to rotate this image using ...
2
votes
0
answers
65
views
Perl Graphics Command Works in Command Line, But Doesn't Work as a CGI
We have an old Perl script that generates a PNG graphic file to show a line-chart in an internal web page. We use that Perl script as a CGI in an Apache web server. It works fine for many years. ...
0
votes
0
answers
52
views
MacOS Monterey - PHP extension GD is not loaded
On MacOS (Monterey) I switched PHP version to 8.0. With MAMP 6.3 (not PRO).
In my source code (PHP, Nette), when I want to work with Image library, I get error "PHP extension GD is not loaded&...
0
votes
1
answer
24
views
Why the value of my variable keep changing in this function?
In my understanding of the code below, the value of $image should be always the same (original value passed to the function), but surprisingly for me it keeps changing (the value of the first dd() is ...
1
vote
1
answer
252
views
apt-get command not working on xampp, running windows 11
I'm facing error in wordpress on my local server while trying to edin an image, it says "Image rotation is not supported by your web host."
I have a Windows 11 64-bit PC that runs a XAMPP.
...
1
vote
0
answers
72
views
How to update old GD library version in PHP?
I noticed that the version of the GD library pre-installed in PHP 8 is very old.
I used this function gd_info() to check the version of the GD library and this is the output:
[GD Version] => ...
0
votes
0
answers
20
views
cutting out parts of an image
PHP has https://www.php.net/imagecrop but what if I want to do the opposite of crop? I want to provide the coordinates to a given rectangular area and delete just that area instead of keeping just ...
0
votes
0
answers
14
views
trying to turn an image a shade of maroon [duplicate]
I'm trying to turn an image a shade of maroon. For example, consider the Google logo:
I'd like to make that look like this:
I created that in Adobe Photoshop by creating a new layer, using the Paint ...
2
votes
0
answers
257
views
Cannot enable Freetype for gd in php 8.1.5 docker container
Problem: Call to undefined function imagettfbbox. Output of function_exists('imagettfbbox') is false.
I've seen so many Dockerfiles now, and it seems not so difficult to enable Freetype with gd. ...
0
votes
1
answer
23
views
How can i INSERT the result of this function to MYSQL?
one of the input tags in my form gets a URL of a png image. here i'm resizing the image using first the "imagescale()", and then the "imagecrop()" function. i'm trying to "...
0
votes
1
answer
40
views
Images aren't rotating
Alright. I've been looking around for a solution for some time now but I cannot seem to figure out why images aren't rotating on my Debian server using PHP.
$content_id = escapeQuery($_GET['id']); // ...
0
votes
0
answers
12
views
PHP gd-extension for php-fpm [duplicate]
I am new to php-fpm
We are using PHP with Apache 2.4. After switching from php7_module to proxy_fcgi_module the gd extension is not found anymore. How can I make sure that it is used?
Problem for ...
-1
votes
1
answer
112
views
how to add php gd with composer (laravel 8) [duplicate]
I trying to add php gd to the composer.json.
I want to install php gd because of the following error :
The PHP GD extension is required, but is not installed.
The error was caused by dompdf ...
0
votes
0
answers
22
views
PHP Change one frame from another
I have code:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Электрическая схема</title>
</head>
<frameset rows="50%,50%...
0
votes
0
answers
19
views
PHP GD and image, seem to alter lots?
I want to create a graph using GD in PHP,
however, lots of things seem to work different ?? in PHP after the
<?php
header ('Content-Type: image/gif');
statement
I cannot use r_print, it seems ...
0
votes
1
answer
192
views
PHP 8.1 imageavif(): AVIF image support has been disabled
PHP 8.1.4 (Installed via remi repo) runing on CentOS 8 Stream
I tested avif support on the machine:
php -i | grep AVIF
AVIF Support => enabled
php -r 'echo gd_info()["AVIF Support"];'
1
...
0
votes
0
answers
158
views
Install GD extension in php8 from alpine 3.13
I have added the following code in my Dockerfile
RUN echo -e "http://nl.alpinelinux.org/alpine/v3.13/main\nhttp://nl.alpinelinux.org/alpine/v3.13/community" > /etc/apk/repositories;
RUN ...
0
votes
0
answers
32
views
How to save a captcha image, made with GD as a jpeg file?
I wrote some codes to make a captcha code using GD in PHP. Everything is OK but when I right-click on the image which is showing the captcha code (to save it as image), file name on the window that ...
0
votes
0
answers
30
views
imagejpeg function shows a long content
I'm trying to write a code for making captcha images with GD in PHP. everything works fine but there is a problem that when I output the image with imagejpeg() function in addition to photos, it also ...
0
votes
0
answers
46
views
imagecreatetruecolor() returns corrupted (?) data
I am trying to figure out how GD works in php. When I create a GDImage from a file, I can display it properly but if I try to create the GDImage with imagecreatetruecolor() or imagecreate(), all I get ...
-1
votes
1
answer
203
views
Installing PHP Extentsions in Bitbucket Pipeline Composer image
What is the correct way to install and enable PHP Extensions in a Bitbucket Pipeline?
Our bitbucket-pipelines.yml uses image: composer:2.0 which worked fine until a unit test was added that requires ...
0
votes
0
answers
16
views
Can I modify a GD's modified image with GD too?
I am trying to put a modified image with GD PHP into another GD script too.
When, the first part of the script (blur, resize, fit if smaller than 1920x1080)
and, the second part (add an alpha friendly ...
1
vote
0
answers
20
views
How to replace image alpha layer using PHP
Is there efficient way to replace alpha channel of target image with contents from another image (eg. red channel)? Now I'm using this code, but it's the slowest part of the whole app. Is it possible ...
0
votes
1
answer
66
views
imageantialias() doesn't seem to do anything on circles
I create an image with:
$image = @imagecreatetruecolor(320, 45) or die("Cannot Initialize new GD image stream.");
imageantialias($image, true);
imagefill($image, 0, 0, imagecolorallocate($...
1
vote
1
answer
285
views
Call to undefined function Intervention\Image\Gd\imagecreatefromjpeg() Laravel 8 + Docker desktop 4.4.4
This is my docker file:
FROM php:8.0-fpm-buster
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-...
0
votes
1
answer
316
views
No JPEG support in this PHP build
I'm trying to setup my docker environment so I could run my phpUnit tests, I get and error No JPEG support in this PHP build while loading fixtures with pictures, I have gd extension installed but for ...
1
vote
1
answer
62
views
Strange artifacts when resize image with php and GD
I'am resizing very large jpg images (4164x4724) to 1/8 of their original size using GD library in php and saving them to webp format. Images of clothes contain very detailed structure of the cloth, ...
0
votes
1
answer
58
views
Keeping a php script active
I was thinking of uploading some huge images onto my webpage and figured I could possibly optimize the load using a special image viewer with zoom functionality. As I've understood from long ago is ...
1
vote
1
answer
113
views
Circos execution fails due to missing module GD which causes dyld[14230]: missing symbol called
First of all I would like to mention that I am not a programmer and neither do I have an english mother tongue, but I will try to do my best :-)
I was looking for a way to create some nice circular ...
2
votes
0
answers
3k
views
Docker: php:8.1.1-fpm-alpine Install specific GD version
Is there any way to specify installed GD extension version?
Currently I have following Dockerfile:
ARG PHP_VERSION=8.1.1
FROM php:${PHP_VERSION}-fpm-alpine
RUN apk add --update --no-cache freetype ...
0
votes
1
answer
41
views
PHP GD - How to apply anti-alias on line's thickness (diagonal line)
I have an image below created with PHP GD (Graphics Draw), the image is created with imagepng().
My problem is that the diagonal lines are not smooth. My senior told me to try to look up anti-alias ...
0
votes
0
answers
68
views
Open Jpeg file, write data to file, add iptc tag, add text to image in flight
I'm hoping to in-flight edit images that are served through wordpress by leaning on php-fpm
Using nginx I have all images passed through a script
server {
...
location ~* \.jpg$ {
...
0
votes
0
answers
48
views
PHP GD save JPG as WEBP not all images displayed in Opera
I have interesting situation, when some of images on the page do not displayed in Opera, just rectangle instead of the image.
imagewebp() return true all the time and in Firefox all works fine.
Some ...
0
votes
0
answers
34
views
What is the php GD library-defined font path?
The following code does not work on my xampp system:
imagettfbbox($fontSize,$angle,"Vera",$txt);
The error is:
Warning: imagettfbbox(): Invalid font filename
The following code does not ...
-1
votes
1
answer
38
views
I need to compress the thumb images | PHP
Hello Stackoverflowers,
I have successfully been able to compress the main uploaded image, but I don't know how to use the same function to compress the thumbnail.
The code main purpose is as follows:
...
0
votes
0
answers
93
views
GD Library extension not available with this PHP installation. I am windows user
I have try to solve this. But I can't. In my Xampp/php/php.ini I have changed my "extension=gd" as uncomment. But still it shows me error as GD Library extension not available with this PHP ...
0
votes
0
answers
220
views
PHP 8 GD instantiation in another class
I have a PHP class to handle creating charts in GD which works great in PHP 7.4, but since PHP 8.0 changed GD to require a GDImage instead of resource, it no longer works. (PHP 8.0 is required; ...
1
vote
0
answers
37
views
Low quality in php imagejpeg() with quality=100
I try to use simple resize/crop script to create thumbnails.
$imageObject = imagecreatefromstring(file_get_contents($path.$image));
$originalWidth = imagesx($imageObject);
$originalHeight = imagesy($...
0
votes
0
answers
26
views
PHP GD: Antialised Arcs? (not "filled" arcs)
is it possible to draw Antialised Arcs using PHP GD?
I found these 2 older classes (2011/2012):
1) Antialiased Filled Arcs
http://www.ulrichmierendorff.com/software/antialiased_arcs.html
This works ...
1
vote
1
answer
2k
views
Impossible to install php-gd on docker alpine version 3.14 or newest
I trying to build gd on PHP container and it's impossible to build it with alpine version 3.14 or 3.15, but work's fine with alpine 3.13.
My Dockerfile
FROM php:8.0-fpm-alpine
RUN apk add --no-cache ...
0
votes
0
answers
113
views
PHP GD - Crop png to circle with transparent background (both source and result)
I found a code online which crops an image to circle.
My problem is: The result has black background and pixelated border.
What I need is to crop any image format to png with full transparency ...
0
votes
1
answer
30
views
imagettftext() is Not Working even after activating GD library
I am able to see the image result with imagemerage successfully but imagettftext is not working please help me to solve this issue.
header('Content-type: image/jpeg');
$dest = imagecreatefromjpeg('...
0
votes
0
answers
37
views
How to create custom virtual cards images of dynamic payments in php?
I want to know if there is any way to create images of a visa card, for example, but with my website logo and so on. Here's an example screenshot.
When generating the image I choose the card number ...
0
votes
0
answers
32
views
Missing Function imagettfbbox()
Running Ubuntu 21.10 with latest Apache2, PHP and MySQL, I noticed Call to undefined function imagettfbbox() errors on the Apache log which apparently relates to missing GD or Free Type libraries but ...