gd

Image processing class in PHP

I need to build a PHP photo processing class, I know there are MANY that already exist to the public but I need to build one to do just what I need done and nothing extra and nothing less. I need my class to do this... 1) I create a new instance of my class and I pass in either a URL of a photo, or the path to a local photo being up...

How to check a PNG for grayscale/alpha color type?

PHP and GD seem to have trouble creating images from PNGs of type greyscale with alpha when using imagecreatefrompng(). The results are incredibly distorted. I was wondering if anyone knew of a way to test for the colour type in order to notify the user of the incompatibility? Example: Original Image: http://dl.dropbox.com/u/246391/R...

Does the GD library use a lot of memory?

I want to use GD library in my PHP script to generate a small thumbnail of a random big picture from external server. Every time the page is called, the GD library will regenerate a thumbnail and show it. Will this slow down the server or use up an unusual amount of memory? ...

generating personal image to use as signature

i want to make a personal image, that shows the last 3 items from the user (so he can use as forum signature, but it cant be a dynamic image like user?id=1 because most forums blocks that) im planning to use GD, thats not a problem but: - to update the image as data is inserted, do i just put a "update image" in the insert script or ther...

Wordpress - GD Star Rating - turn off and on for specific posts?

Hi all fellow Wordpressers, I'm trying to apply GD star rating plugin to 4 specific pages. I know I can do it in the page editor, but I have about 30 pages so don't want to spend ages going through them all. Is there a way in the GD settings to default the plugin to not putting the block automatically on every page. Thanks for your hel...

Unable to create GD image resource from BMP with MIME type 'image/x-ms-bmp' in PHP

I'm trying to create a GD image resource from a BMP image, however I'm having no luck. The BMP image in question was created and saved with Photoshop. I've tried a couple of BMPs I found on the web too, and they gave the same results. getimagesize() tells me the BMP image has an image type of IMAGETYPE_BMP (6) and a MIME type of 'image...

improve my thumbnail generator ?

Hi, i have a this function which resizes images but the final quality looks blurred too much and not clear: Any other class or a solution to improve the quality of thumbnails ? Thanks Other Note - i already changed the quality to 100 but nothing happened! ...

php scripts for rectangle gd png image

How can I split from an image that is 4500x80 pixels into a smaller rectangular images? I'm using php with gd installed on ubuntu 9.04 from the input source file containing alphabetic characters of more than 800. It is supposed to draw a rectangular barcode image of various colors assigned to input characters of A, G, C, T. A=Green, G=...

i cant use imagecopyresized

I have a problem with the GD functions. When I upload an image on localhost, everything works fine, and a thumbnail is created, but when I upload my website on hosting then imagecopyresized just fails. When I insert in a blank page, that function (whole resize function) it works just fine. What could be the problem? Update: Actually ...

I think i have a vector image format, how do use it to draw an image in php?

I have found an image format that is being used by some applets. but i don't know what it is. I think it is some kind of vector graphics format that is used by the GD library. could someone help me decode it? I would like to use the raw data to produce a png, in php the data is being generated from squiggles drawn by the mouse. Is t...

PHP GD Text/Transparency/alpha problem.

alright so im having a problem with getting my text layed over a partly transparent image. i want the text to be solid, but i want part of the background of the image to be transparent, and the part the text is over to be solid, which i have, the problem is the text is inheriting the transparent background of one of the previous layers. ...

PHP Image Magick / Text-to-PNG - many lines & switch fonts inside image-build

Greetings. For a PHP-Project, I have to build PNG-images where I pass some text and then let imagick generate the image for that text. I did this kind of stuff with success in gd, but only had 1 font (per text-generation-block) to play with. As I want to change between 2+ fonts while generating this textblock I read a lot in Google, bu...

Accented characters not showing when using imagettftext with otf but showing with ttf

I'm using imagettftext to generate images from OpenType files. Everything works until I try to use an accented character (e.g. å) or a character such as √. In their place I get the .notdef glyph. The fonts I'm using definitely have these characters. To make things even more frustrating, when I use a TTF everything works as expected. An...

Scale down animated GIF with PHP GD

Is it possible to scale down a animated GIF with PHP GD so that it's still animated? If so, how? ...

How to create multiple line-breaks in a dynamic image when needed?

Currently I've got the following working just fine without any problems (yet). header ("Content-type: image/png"); $string = $_REQUEST['text']; $font = 15; $width = 300; $height = 350; $image = imagecreate($width, $height); $back = ImageColorAllocate($image, 255, 255, 255); $border = ImageColorAllocate($image, 0, 0, 0); ImageFilledR...

PHP gd library clarification

I'm looking at this code and have been through the docs but still don't understand how this should work. The code works fine just as it sits but I'm wondering if I should be outputting the header as png instead of jpeg. What exactly is going on in this code? Is the png image converted to jpeg? What I ultimately want to do is to waterma...

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 8. http://www.mattdsworld.com/mmaplayer/index.php/tournament/viewBracket/2 http://www.mattdsworld.com...

Get image mimetype from resource in PHP/GD?

I'm trying to find the mime type of an image. PHP has the function getimagesize but that only takes a filename, whereas I have an image "resource" instead - i.e. an image created from imagecreatefromstring. I found the functions imagesx and imagesy which return the width/height from a resource but I can't find any function that tell me ...

Convert GD image back to binary data

I have a GD image resource created from imagecreatefromstring. After some image operations, I want to convert it back to binary data. How would I do this? Can't see any functions in the manual... ...

How to use/link gdLibrary (libgd) with MS Visual C++ (e.g. 2008 Express Edition)? Getting LNK2019 errors...

Hi all, I have to use the gdLibrary (http://www.libgd.org) in a C++ App on MS Windows XP Prof. SP3 32bit - and I'm trying and googleing for two days now without success. Does anyone of you use libgd with MS VC++ 200x EE? My problem: It has to to compile with MS Visual C++ (e.g. the 2008 Express Edition - fixed 3rd party condition)... b...