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

Merging multiple overlapping transparent png images with php

I have a custom bicycle configurator that layers transparent png files with css. http://www.gallantbicycles.com/build/no1/ I need to add the ability to combine them into one file dynamically so the user can download an image or share it. This is…
Jason Wood
  • 351
  • 1
  • 5
  • 13
1
vote
1 answer

Perl GD:Graph y-intercept

I am making a graph using GD:Graph in Perl, but I am unsure how to tell the line to start at a certain point. I have the slope, but it automatically starts at the point 0,0. I'm not sure where I can specify the y-intercept at the very least. I…
R0drom
  • 51
  • 6
1
vote
2 answers

dpkg error exit status 2

Trying to build php from source on Ubuntu 9.10 to enable GD2, but when i run dpkg-buildpackage, it just quits giving me this error: QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null pop -a -R || test $? = 2 Patch suhosin.patch does not…
Guillaume
  • 11
  • 1
  • 2
1
vote
2 answers

PHP - multiple users edit the same image simultaniously

I am looking to have multiple users edit the same image using the gd library's imagecopymerge function. I am worried that two users might select to edit the image at the same time. The application then merge's the two users images seperately and…
Mark
  • 5,423
  • 11
  • 47
  • 62
1
vote
0 answers

Incorrect Variable Font Size for Generated Image depending on Browser

I have a simple PHP script that takes a base image adds some text on top and delivers the result to the browser. The problem is that the text appears to be different sizes on different browsers. I cannot for the life of me understand why. Isn't…
Eric Anderson
  • 3,692
  • 4
  • 31
  • 34
1
vote
0 answers

Using GD Perl to show values over the respective bars on x-axis

I've generated a dynamic graph based off of the data from my MySQL db, and now I'm looking to see if there is a way that GD or one of its packages allows you to add the values of what each bar is above that bar. Basically the data is very specific,…
byobob
  • 99
  • 1
  • 13
1
vote
1 answer

Crop image using GD library

I am using GD library in my Perl script that allows me to draw a true-type-font text. Because I don't know exact size at the beginning, I set my $i = new GD::Image(3000, 3000); and then I draw my text my $black = $i->colorAllocate(0, 0, 0); my @b =…
Ωmega
  • 42,614
  • 34
  • 134
  • 203
1
vote
0 answers

White background transforms into an other color after image creation

So the user uploads an image (jpeg, gif or png); And I should convert it to PNG, so I'm doing something like: if ($typeImgFunction == 'jpeg') $imgCreate = imagecreatefromjpeg($fileName); else if ($typeImgFunction == 'gif') $imgCreate =…
Alucard
  • 1,814
  • 1
  • 21
  • 33
1
vote
1 answer

PHP GD and True Type Font

I have a weird issue with TTF and PHP GD 2.x. I have a size 45px TTF at top position 100. The top of the text is perfect align with a line (in the image). BUT if I change the size of the font, the text is no longer align with the line. At size 20px…
lebill
  • 1,293
  • 2
  • 8
  • 9
1
vote
1 answer

GD/PHP heatmaps on geographical background

I am trying to reproduce the heatmap effect Bungie uses to show kills/deaths on specific halo 3 maps using PHP and GD. (Example: http://www.bungie.net/stats/halo3/heatmapstats.aspx?player=gatts007 - pick a map like "Guardian" for a better…
EToreo
  • 2,936
  • 4
  • 30
  • 36
1
vote
3 answers

Create base64 string from HTML

I need to make screenshot from specific DIV in HTML page. I tried to use this library - http://html2canvas.hertzen.com/ html2canvas($(".element"), { onrendered: function(canvas) { console.log(canvas.toDataURL('image/jpeg')); …
DoubleT
  • 67
  • 3
  • 11
1
vote
0 answers

imagefttext() [function.imagefttext]: Could not find/open font in

Am trying to use the gd library with freetype to write some texts on my image for facebook app(find code below) but am having the error: Warning: imagettftext() [function.imagettftext]: Could not find/open font in…
user2599068
  • 21
  • 2
  • 6
1
vote
2 answers

PHP images add txt

I am trying to get it to show text1 and text2 on the same image only Text1 is showing up $rImg = ImageCreateFromJPEG("test.jpg"); $cor = imagecolorallocate($rImg, 0, 0, 0); imagestring($rImg,5,126,22,"Text1",$cor); …
Rickstar
  • 6,057
  • 21
  • 55
  • 74
1
vote
1 answer

The image by gdImageCopy is grayscale

Though I want to to conflate some image and white canvas with GD, Following program makes the conflated image grayscale. #include #include #include #include int main(int argc, char *argv[]) { gdImagePtr…
cubicdaiya
  • 368
  • 1
  • 6
1
vote
1 answer

Decoding json string from facebook graph api explorer in php

I am using the graph api to get the profile picture of my facebook app user to a specified width and height. The url: http://graph.facebook.com/'.$userid.'/picture?width=180&height=220 This will return something in json like { "data": { "url":…
user2599068
  • 21
  • 2
  • 6
1 2 3
99
100