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 Imagick Class - Convert JPEG's to Progressive JPEG's? Interlace not working

I'm trying to finish up my image uploader that utilizes imagick for the handling of various image types. One thing specifically that I'm trying to get working is the conversion of jpeg files to progressive jpeg. I've tried the following code below,…
Braydon Batungbacal
  • 1,028
  • 2
  • 24
  • 52
1
vote
1 answer

PHP gd extension missing from Google App Engine local Development Server

I've successfully been able to install Drupal onto GAE PHP (the real online one) but can't do so with the local Development Server of Google's App Engine because it complains the gd extension isn't enabled. I'm on OS X. Has anybody else found the gd…
pilcrowpipe
  • 2,528
  • 6
  • 29
  • 41
1
vote
3 answers

Store an image into DB

I use a script (http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/) that handles an image and then create a thumbnail. Actually I don't want to store images on the file system but I want to store them in a mysql db in a BLOB field.…
Pennywise83
  • 1,784
  • 5
  • 31
  • 44
1
vote
0 answers

Using imagepng() with stream wrappers fails

On my local server, I am able to create an image with GD and then export it using imagepng($imgResource, $path) I am trying to deploy to an AWS instance, and on the AWS instance I always receive an error Unable to open 'public://pictures/pic.png'…
tigertrussell
  • 521
  • 2
  • 13
1
vote
1 answer

Create a tiled image with offset

In the process of creating a tiled image I'd like to set an offset (so that the tile doesn't start at 0, 0) but when I provide what I'd expect to give me the correct image, it's not rendered correctly. I'm setting the tile using imagesettile($image,…
Brian Barnes
  • 1,009
  • 7
  • 15
1
vote
1 answer

To understand math behind resizing an image while keeping the ratio

i don't know if this question fits here but i want to understand the formula for resizing an image while keeping the ratio in PHP GD library or in anything else. For example here is an…
user1002601
  • 379
  • 5
  • 19
1
vote
0 answers

Set Font to Fit Defined Width PHP GD

I'm new to using PHP's GD library and I'd like to be able to resize (shrink/enlarge) my text to fit a certain width. As an example, say I have a string, "Hello World". What is the easiest way to have this string resize itself to fit within a…
William Orazi
  • 1,694
  • 6
  • 23
  • 36
1
vote
2 answers

Splitting APNG into png images with PHP

I have a php code that splits an animated PNG image (APNG) into frames, but there is some kind of error. The images that are created by the function are not valid (PHP does not return an image resource in PHP imagecreatefrompng() function (neither…
Timur Gafforov
  • 771
  • 3
  • 10
  • 28
1
vote
1 answer

How to turn a jp2 image to a jpg file?

How to turn a jp2 image to a jpg image in php using the gd library. Thanks
Elena Roman
  • 137
  • 8
1
vote
1 answer

imagepng shows "cannot be displayed" error

I dunno why, but there's something weird about imagepng. Whenever i use imagepng($image_p,NULL,9); it uploads the file and displays it on the page but when i use imagepng($image_p,'upload/test.png',9); it does upload the image, but the page returns…
MrPowerhouse
  • 63
  • 10
1
vote
1 answer

Setting background color as transparent while creating PNG image from EPS file

Im using PHP Imagick to process images, I need to convert an EPS file into PNG file and next the remaining code can process the created PNG, Im able to convert EPS as PNG and can process to, but when i do this the PNG file is creating with white…
Peterson Andrew
  • 243
  • 6
  • 16
1
vote
2 answers

Gradient text fill using GD - PHP

I need a function that renders gradient on a text using GD something like function gradientText($text,$font,$color1,$color2) { .. }
1
vote
0 answers

Keep Centered Edge Text Rotate imagettftext()

I Try to rotate Text using GD Library, while keeping centered edge of the rotation (like photoshop or CSS3 Transform), But, the result isn't same like Photoshop or CSS3. Edge point of the text is "Top Left", not centered. I try this trick for rotate…
Eirudo
  • 31
  • 7
1
vote
1 answer

How do I create a transparant area inside a non transparant solid color image using GD or Imagick?

Using imagick and GD Library I tried to make a square image with a transparent center. I tried to do it like this : $img = imagecreatetruecolor($width, $height); imagefilledrectangle($img, $left, $top, $right, $bottom, imagecolorallocate($img,…
NoOne
  • 171
  • 1
  • 12
1
vote
2 answers

broken image PHP (GD)

My image looks like this: Its getting the image from antibot.php Here is my antibot.php