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
5 answers

How to flip text vertically/horizontally using php?

Does anyone know how to achieve this?
Anatoliy
  • 29,485
  • 5
  • 46
  • 45
1
vote
1 answer

How to force browser to cache on-demand generated images?

An URL such as http://mydomain.com/text/SGVsbG8gd29ybGQh/params/Y29sb3I9I2Y5NzMwNixmb250LWZhbWlseT1Db21pYyBTYW5zLGZvbnQtc2l6ZT0yMnB4LGZvbnQtd2VpZ2h0PWJvbGQsZm9udC1zdHlsZT1ub3JtYWwsdGV4dC1kZWNvcmF0aW9uPW5vbmUsdGV4dC1hbGlnbj1sZWZ0/96 calls on a PHP…
Andrei Oniga
  • 8,219
  • 15
  • 52
  • 89
1
vote
1 answer

PHP Swatch download, only generating 2 colours?

I've been working on saving swatches out as images using PHP, I made a head start on it and so far it's saving out the first colour, and last colour and black - but iterating the last colour for three blocks.
user1679857
1
vote
2 answers

resizing an image with GD in PHP for upload to S3

So I'm having some trouble writing a GD function in PHP to resize all images uploaded tto 150x150px before storage in my s3 bucket. To confirm, this code works currently, there is just no resizing function, and I can't seem to find a simple GD…
user2656127
  • 655
  • 3
  • 15
  • 31
1
vote
1 answer

How to convert a PDF into image exactly similar to the PDF with PHP/Imagemagik/Ghostscript

Im generating PDF documents with PHP(TCPDF is the library behind) and for displaying them Im converting them as images using ghostscript, and displaying the previews, but the preview doesnt actually similar to the PDF document. The code Im using to…
Peterson Andrew
  • 243
  • 6
  • 16
1
vote
1 answer

How to serve PHP dynamic images efficiently on a LAMP server?

Right now I'm running a PHP script on my LAMP (CentOS/Apache/MySQL/PHP) stack that generates dynamic images using GD. I'm caching them on the hard drive for 5 minutes. If a cached version exists, I pull that instead of generating a new one. This…
Chris
  • 65
  • 1
  • 4
1
vote
1 answer

PHP imagecopy & imagecopymerge changing background from transparent to black

I am copying one image and placing over second image, second image is transparent in background. While copying background of second image is converted to black. Even if i display image just after initializing image from file, it gives me black…
user3440239
  • 78
  • 1
  • 5
1
vote
0 answers

Creating the same thumbnail, one way is slower... why?

I'm looking into what is slowing some scripts of mine down. I have got the following scripts, essentially the same, the only difference is one is in a subfolder and uses $_SERVER['DOCUMENT_ROOT'] to get the image url. Script 1…
Martyn Ball
  • 4,679
  • 8
  • 56
  • 126
1
vote
1 answer

php image filter "colorize" destroys image details

i am trying to to colorize a black and white picture on my server. i have tried doing this with multiple methods and the only one that kind-of-works is gd imagefilter via filter IMG_FILTER_COLORIZE. it does kind of colorize the image in exactly the…
user151496
  • 1,849
  • 24
  • 38
1
vote
1 answer

Unable to horizontally center 'm' with GD2

My goal is to draw a horizontally centered m. I therefore calculate the width of the letter, substract that value from the total width and finally divide by 2. The result should be the distance from the left (or equally from the right). However, the…
ComFreek
  • 29,044
  • 18
  • 104
  • 156
1
vote
0 answers

PHP GD not sizing down image by a certain percentage

I have the below script, it all works fine, apart from if I enter a value into the function arguments for the percentage, the overlay's are too large, they should scale down by #% of the max size. Here is an example: But then if I change the "80"…
Martyn Ball
  • 4,679
  • 8
  • 56
  • 126
1
vote
0 answers

get perl GD to work

I am trying to get the GD perl module to work on my mac. I have installed the gd library $ gdlib-config --all GD library 2.1.0 includedir: /usr/local/include cflags: -I/usr/local/include ldflags: -L/usr/X11/lib -L/usr/local/lib libs: …
user3266890
  • 465
  • 5
  • 15
1
vote
1 answer

I cannot see a created dataset in cloudconnect

I have created a dataset user in logical data model and publish it. Then, I wanted to connect the dataset in GD Writer, but in select box the dataset is not supported to be select. Does someone know where is the problem? Thank you very much!
Petr Jirásek
  • 453
  • 1
  • 5
  • 17
1
vote
0 answers

php image re-sizing with defined minimum height and width

I have a file field and I upload a file using PHP. I need to re-size the image but I should get minimum height and width, which means no matter what is the size of the original image, if I re size the image the height should be greater than 180px…
Joel
  • 49
  • 7
1
vote
1 answer

Drawing a tournament bracket (PHP & GD)

I'm currently working on drawing a tournament bracket for one of my projects. It seems to be working drawing smaller brackets but once I get to 16 it starts acting up. Follow through the links, and see how it falls out of place after…
Matt Dunbar
  • 950
  • 3
  • 11
  • 21