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

PHP Image Resize and Crop Sometimes Flips Image Upsidedown

I have a script that works fine on most images but it is flipping this image upside down: This Image Will Flip For Some Odd Reason Here is the script I'm using:
webdev
  • 339
  • 1
  • 9
1
vote
1 answer

Perl GD Check If Pixel is Transparent

I've been trying to solve this for a while. I have to check if a given pixel(x,y) is fully transparent. 1.How to Extract the alpha channel from a given pixel? Having an alpha channel of 127 will mean that the pixel is transparent? 2. I have tested…
DanielLazarov
  • 160
  • 3
  • 13
1
vote
0 answers

GD library installed but not working on ubuntu

I've installed GD and run the following: php -i | grep -i gd which returns: /etc/php5/cli/conf.d/gd.ini, gd GD Support => enabled GD Version => 2.0 gd.jpeg_ignore_warning => 0 => 0 I run PHP5-fpm with nginx, without the use of apache2. I have also…
DT.DTDG
  • 765
  • 1
  • 13
  • 31
1
vote
1 answer

cant change font type in dynamic image

cant seem to get the font to work , so far i've seen that the imagestring doesn't support the font being changed so im trying to work with imagettftext like so imagettftext($finalImage, 20, 0, 11, 21, $textcolorBlue, $font2, $text); but instead of…
1
vote
3 answers

PHP - Compress Image to Meet File Size Limit

I have to upload image files that meet a max width dimension and max file size. I have the code that checks width size and resizes the image to meet the max image width. However, when I am saving the file I can set the quality imagejpeg(…
nomaam
  • 1,213
  • 2
  • 22
  • 37
1
vote
3 answers

How can I optimize this image "edge detection" algorithm?

I have a function that, given an image with a transparent background and an unknown object in it, finds the top, left, right and bottom boundaries of the object. The purpose is so that I can simply draw a box around the boundaries of the object. I'm…
mmatos
  • 121
  • 1
  • 6
1
vote
1 answer

Animated gd frames

Is there a way to issue frames in a animated gif using php gd imagery?
Joseph Robidoux
  • 351
  • 2
  • 6
  • 13
1
vote
2 answers

Call to undefined function imagettfbbox()

I've installed PHP 5.5 on CentOS using the IUS repos and unfortunately I cannot use GD even after installing everything recommended: Package php55u-gd-5.5.14-1.ius.centos6.x86_64 already installed and latest version Package gd-2.0.35-11.el6.x86_64…
Jordan Doyle
  • 2,976
  • 4
  • 22
  • 38
1
vote
4 answers

Creating PNG thumbnail using PHP

I'm trying to create a thumbnail image it returned an error, that imagecopyresized() expects 2 parameter to be resource, but it can create the image but the output is only a small black image. here is my code $image = "asd.PNG"; $image_size =…
user3746881
  • 51
  • 2
  • 9
1
vote
1 answer

Getting memory error with GD

i'm having trouble with a script i modified, i used this class https://github.com/thenakos/compare-images since i wanted to check if in a determined folder there were only uniques photos. public function scanDir($d) { /*function to find same…
ToniZ
  • 21
  • 1
1
vote
4 answers

PHP-GD How I can check the type (jpeg, gif ..) with a url of facebook?

If a user has no photo facebook instead of a jpeg get a gif. How I can check the type? I have tried the following: $PIC_Friend = imagecreatefromstring(file_get_contents('http://graph.facebook.com/'. id .'/picture?width=50&height=50'));…
ephramd
  • 561
  • 2
  • 15
  • 41
1
vote
1 answer

PHP merge two images with imagecopymerge()

There is something very weird happening with my imagecopymerge function in PHP. I am trying to merge these two png files one on top of the other and the position where these will be merged is obtained dynamically from a drag-able canvas in an html…
jake2389
  • 1,166
  • 8
  • 22
1
vote
2 answers

imagecreatefromstring can get url or file?

I have an image with this src attribute http://myhost.lan/images/log/parts/bg/001.png can i pass this url to imagecreatefromstring function as a string? what's the exactly mean of imagecreatefromstring — Create a new image from the image stream in…
foozhan
  • 85
  • 1
  • 14
1
vote
4 answers

image resize but without any compromise in DPI?

I want to resize a image with DPI 300 or greater.. I want it's DPI to remain intact... I have used GD library function to resize image cropped but it brings down DPI to 90! please give a solution as my requirement involves no downsizing of DPI
ashofphoenix
  • 123
  • 1
  • 6
1
vote
0 answers

Strange artefacts with imagecreatefrompng and imagepng compression

My simple goal was to compress PNG files with the following code: $image = imagecreatefrompng("test.png"); imagepng($image, "result.png", 9, PNG_ALL_FILTERS); I've also tried with zero and default compression, with the same results. Original file…
zeldi
  • 4,833
  • 3
  • 19
  • 18