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
0
votes
1 answer

Running imagecreatefrompng throught image array but array just returns 1 image

I'm trying to crop of the bottom part of an image, which i get from a remote site. Got it also working with the following code: $u = $xmlString->xpath('//*[contains(@u, "/fds/")]'); foreach($u as $result) { $itemLinks =…
dane.
  • 13
  • 2
0
votes
1 answer

PHP GD Complex stacking multiple layers

I have an image stacking process that I am trying to accomplish with PHP GD. What I have is the following: 3 Images: Masked clipart Clipart texture Final background My masked clipart has black in place of where transparency will be after the…
chpx
  • 146
  • 1
  • 8
0
votes
1 answer

How to re-size the image to specific dimensions(without compromising the quality of uploaded image) uploaded by user in optimum way using PHP?

I'm using PHP, jQuery, AJAX, HTML, etc. for my website. I'm a newbie to PHP. I have used one jQuery image slider in my WebApp. For this image slider user uploads images. Further, these uploaded images are displayed into this image slider. This…
PHPLover
  • 1
  • 51
  • 158
  • 311
0
votes
2 answers

"Composer Update" error after gd install in ubuntu vagrant box

Hi i have the following dependency in my composer.json "require": { "gd": ">=2.0.28", "ext-gd": "*" } when i do composer update it gives the following error... Your requirements could not be resolved to an installable set of…
dipak1296
  • 349
  • 2
  • 3
  • 16
0
votes
2 answers

imagecopyresampled lossing quality an image php

I want to copy re-size merge an image using imagecopyresampled in php. It is resizing properly but loosing it's quality or i can say its edges getting destroyed why? Below is my code please view it and give solution.PHP GD-Library.
Anand Jain
  • 779
  • 2
  • 10
  • 32
0
votes
1 answer

Resizing image using PHP GD and saving the image. What's wrong with this code?

I've used this code to detect the file type and use relevant image GD functions to resize and store images in the specified file location. Arguments are defined as: the original file location, file type and file name. File type and file name are…
Akshay Khetrapal
  • 2,586
  • 5
  • 22
  • 38
0
votes
2 answers

Why is there an image2wbmp but no image3wbmp, etc?

PHP has a function called image2wbmp, but there is not image3wbmp, image4wbmp, and so on. Why is that? Did the language designers think that image2wbmp would be enough?
Darth Egregious
  • 18,184
  • 3
  • 32
  • 54
0
votes
2 answers

Display png image from php on a certain position on a webpage

The code works fine if i display only image with the help of code. But if i use some other fields like echo some text or i want to put some buttons…
ashwinbhy
  • 600
  • 1
  • 8
  • 30
0
votes
0 answers

How to correctly show accents or special characters (ñ) in php-gd?

How to correctly show accents or special characters (ñ) in php-gd? Currently used code: $TXT_Name = mb_strtoupper('á é í ó ú ñ'), 'UTF-8'); imagettftext($CANVAS, 20, 0, 10, 20, $color, $FONT, $TXT_Name);
ephramd
  • 561
  • 2
  • 15
  • 41
0
votes
0 answers

Why php-gd does not work? not BOM, not error code, php-gd enabled

Any php-gd, for this example:
ephramd
  • 561
  • 2
  • 15
  • 41
0
votes
2 answers

PHP image generation error

I was trying to run an example given in a book that produces a PNG image on the page:
ankush981
  • 5,159
  • 8
  • 51
  • 96
0
votes
1 answer

PHP Fatal error: Class 'imagecreatefromjpeg' not found

I'm trying to create thumbnails for some images. In order to do this I'd like to use the function imagecreatefromjpeg available in the php-gd class (I'm using this function because I found some code on the web that seemed pretty straight forward).…
danboh
  • 758
  • 2
  • 11
  • 28
0
votes
0 answers

PHP GD imagepng function showing up as garbled text

I am reading a book and followed one of the tutorials. After following the tutorial to the letter the program does not work as expected. I found a similar but much simpler tutorial online and found that it does the same thing on my system. I am…
user_loser
  • 881
  • 1
  • 13
  • 27
0
votes
1 answer

Font size with custom font

So I've got my image and even some text on it. I tried to load a font and it worked, but how could I select the font size? The code for the text I have is below. imagestring($img, imageloadfont('dist/font.ttf'), 20, 20, 'Testing!',…
ThePixelPony
  • 721
  • 2
  • 8
  • 30
0
votes
1 answer