Questions tagged [gd]

GD Library is used to dynamically create and manipulate image files.

GD is an acronym for GIF Draw, GD is an open source code library for the dynamic creation of images by programmers. GD is written in , and "wrappers" are available for Perl, PHP and other languages. GD creates , and images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve website development.

2961 questions
1
vote
1 answer

gd resource not valid when running PHP fetch macro in standalone PHP extension

I created a standalone PHP extension using the ext_skel tool in the PHP extension directory of the PHP source. I wrote the necessary PHP_FUNCTION's to take in primitive parameters and they work fine. Now I am writing a function which uses a gd…
EFlash
  • 11
  • 1
1
vote
4 answers

PHP convert 24-bit colors to 4-bit

Background, I am converting images to ascii art. This works perfectly and even works with 24-bit color, converting the colors to the right rgb values. However, I now want to render the ascii art in 4-bit color palette rather than 24-bit. How do I…
nicholas.alipaz
  • 505
  • 1
  • 6
  • 18
1
vote
3 answers

Creating jpg thumb with php

I am having problems creating a thumbnail from an uploaded image, my problem is (i) the quality (ii) the crop http://welovethedesign.com.cluster.cwcs.co.uk/phpimages/large.jpg http://welovethedesign.com.cluster.cwcs.co.uk/phpimages/thumb.jpg If you…
Ross
  • 11
  • 1
1
vote
1 answer

GD blurry images Opencart

I have this problem with GD image processing in Opencart that creates real bad blurry images after resize. Nothing I have tried so far has helped. Below is the code for the image.php
1
vote
0 answers

How can I find where the GD function `stringFT` is defined?

I'm having a problem with some code I've inherited that uses GD: sometimes the function stringFT returns an error. I'd like to debug this function, but I can't find where it is defined in the GD source code. I've searched in all the files under the…
tvs
  • 737
  • 2
  • 17
  • 33
1
vote
3 answers

PHP - Using Cron Jobs and GD together

I have a customer based website which requires them to upload an image, and on doing so my script will save about 25-30 variations of the image onto the server using the GD library. Because of the amount of images there is currently a very long…
odd_duck
  • 3,941
  • 7
  • 43
  • 85
1
vote
1 answer

IMG_FILTER_COLORIZE not working as it should

I am trying to turn a PNG image with a white box to a green box. The background of the PNG is transparent. I have written out code but it doesn't work for some reason. I have looked and tried a lot of things and i cannot see anything wrong with the…
baihu
  • 451
  • 1
  • 4
  • 16
1
vote
0 answers

Change PHP GD image output file url name/link

I have this problem, i have this script in php that creates a image on the fly, the problem is that the outputted image on the browser is allright, but i need to change it's name. Ex: Index.php
moses
  • 11
  • 1
1
vote
1 answer

php magician resize - display image instead of saving to the folder

I'm trying to resize the image and display it on the browser. I'm using php_image_magician to resize the image from database. it resized the image succesfully. I want to display the image instead of saveImage ($magicianObj ->…
Karuppiah RK
  • 3,894
  • 9
  • 40
  • 80
1
vote
2 answers

can't install gd lib on ubuntu

I am not able to install gd library on ubuntu 13.04. When I issue the command: sudo apt-get install php5-gd I gives me followiing error Err http://us.archive.ubuntu.com/ubuntu/ raring-updates/main php5-gd amd64 5.4.9-4ubuntu2.4 404 Not Found…
Nilesh
  • 442
  • 1
  • 4
  • 22
1
vote
3 answers

PHP resize image fixed size but maintain orientation

I need to resize images in php using GD to a fixed size but maintain the orientation (portrait/landscape), these are: portrait: 375 x 500px landscape: 500 x 375px Everything I have tried always ignores the orientation and makes them all…
designvoid
  • 431
  • 1
  • 6
  • 19
1
vote
1 answer

PHP GD image merge changing my image to black

I have a very frustrating situation. I am using PHP GD for the first time, and it's been a bit of a rollercoaster relationship. Basically, I am trying to merge 2 images, a square one (with a height/width of x) onto a rectangle (with a width of x and…
AnthonyB
  • 37
  • 6
1
vote
1 answer

Adding alpha channels to PHP GD Images

I want to create an png image with transparency using the GD functions of PHP. Specifically, I'm have text with different opacity levels (for anti-aliasing). Using the following code I am able to create an alpha in the main part of the…
Hussain Khalil
  • 1,520
  • 2
  • 15
  • 24
1
vote
2 answers
1
vote
3 answers

PHP PNG Image Upload losing transparency

I am trying to upload image using the php GD functions and I have found many solutions to properly upload the image without loosing transparency. I have tried to use most of them but due to some reason I failed every time. My code is switch($ext)…
Yunus Aslam
  • 2,447
  • 4
  • 25
  • 39