gd

php image creating in loop

i have to create number of images with php GD library. but after calling imagejpeg(''name,'',100); The First image is generated and execution is halted with browser window showing the image generator file name. does any body tell me how can i loop to create images in loop my code looks like <?php // Including all required classes req...

Looking for an JavaScript large image editor

I'm looking for a JavaScript image editor, that allow editing large images. Something like what Google Maps does, the client side only shows a small part of the big image that resides on the server. I know Pixastic and CanvasPaint, but them only allow editting complete images loaded in the browser side. Does anyone knows something like...

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 saves CPU time, but since Apache is still running the PHP file it generates a new Apache proc...

Put PNG over a JPG in PHP

Hello I want to do the following in PHP: I have two images, a jpg and a png. I want to resize the jpg to the same size as the png then put the png on top. The PNG has transparency so I would like to preserve that so the jpg shows underneath. If anyone could help that would be great! Thanks ...

PHP - Problem with ImageCopyResampled

Hello. It's my first time using the function ImageCopyResampled. I just followed the code written in the PHP manual. There seemed to be no errors when I ran the code. The problem is my code just basically copies the original image and did not follow the dimensions as it was defined in the parameters passed in the function. Below is my c...

PHP GD not rendering unicode fonts properly.

I am having problems in rendering unicode glyphs ( language : Malayalam, Tamil and Hindi) with PHP GD library. Is this something related to the rendering engine of GD library? Any workarounds available ? ...

Enabling/installing GD extension? --without-gd

How does one enable (or perhaps I need to install) GD when my phpinfo() output in "Configure Command" says; --without-gd ? I also have nothing in my phpinfo() output "Core" that lists "gd" PHP Version 5.2.4 on AWS. Thanks! ...

Problem with imagecreatefrompng (PHP)

Hey guys, in one of my PHP projects, imagecreatefrompng complains, that the image "is not a valid PNG file". Warning: imagecreatefrompng() [function.imagecreatefrompng]: '/.../...png' is not a valid PNG file in /.../...php on line ... I'm pretty sure, the file is valid, because I can open it in any program. So I was wondering what e...

How to flip text vertically/horizontally using php?

Does anyone know how to achieve this? ...

php image arrow line need to be smooth

im making a line in php and so far its showing fine, but what problem im getting now is the line is not being smooth, it shows as breaking edges. following is the code for making radius line: function draw_radius($img, $x1, $y1, $radius, $angle, $arrow_color, $arrow_length = 10, $arrow_width = 3) { $x2 = $x1 + $radius * cos(deg2rad(...

LibGD library is not working: crash when saving image

I've been seeking for JPG saving library for long time for c++, but i cant seem to get anything to work. Now i am trying use LibGD: What im doing wrong ? It seems to work, but the saving crashes. Code: ... #pragma comment(lib, "bgd.lib") #include <gd/gd.h> ... void save_test(){ gdImagePtr im; FILE *jpegout; int black; ...

php: trying to merge multiple pngs together getting error

Note sure what i am doing wrong here... but im trying to merge 3 pngs over into one and it is throwing an error Warning: imagepng() [function.imagepng]: gd-png error: no colors in palette in C:\wamp\www\jeep\public\test\png_2.php on line 22 $x = 300; $y = 300; $final_img = imagecreate($x,$y) or die("Failed in call to imagecreate()...

How to generate semi transparent shapes in php using gdlib

Hi, this is the script i made // Create image $img = imagecreatetruecolor($w, $h); // Transparent image $white = imagecolorallocate($img,255,255,255); imagefilledrectangle($img,0,0,$w,$h,$white); imagecolortransparent($img, $white); //imagealphablending( $img, true ); //imagesavealpha( $img, true ); // Shape color $bgColor = ima...

draw binary tree with php

Hi, I'm looking for a good library / API to draw a binary tree using PHP. I've tried using Image_GraphViz, but it doesn't seem to work. I've also looked at phpsyntaxtree, but its not documented. Alternatively, I'm also looking for a jQuery plugin that does this. (just not this one because it has no documentation). Thanks ...

How can i cut an image from bottom using PHP?

I want to take out the text in the bottom of an image. How can i cut it from bottom ...say 10px to cut from bottom. I want do this in php, i have lots of images that have text in the bottom Is there anyway to do it? ...

Aspect ratio recommendation - use letterbox?

I'm doing some work in GD and I have a series of image sizes that I'm converting from my large 1920x1080 jpg. So for instance: 1920x1080 > 640x480 (4:3) 1920x1080 > 640x360 (16:9) 1920x1080 > 360x280 Should the best practice here to use a letterbox effect or fullscreen? With the letterbox I'll see more of the image, but the latter w...

CAn't resize image with GDlib2

I'm trying to resize an image of more than 3000px in width, it uploads fine if i do not resize it, but as soon as I resize the image it does not want to upload and resize, this is funny and I can't seem to understnd, since if the width of the image is alot smaller everthing works just fine. Are there limitations to this? ...

GD Black Images

I'm trying to create a thumbnail / cutout of a larger image and it works for a large percentage of the time but every now and again I get the following: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 626 extraneous bytes before marker 0xd9 in code.php on line 5 This is line 5 of "code.php":...

creating an image in php using mysql resut set

Is there anyway to create an image outof mysql result set in PHP using GD library? I am ucrrently displaying the resultset in a table format in my php page. ...

PHP Work out colour saturation

Hi there, lets say i have the following RGB values: R:129 G:98 B:87 Photoshop says the saturation of that colour is 33% How would i work out that percentage using PHP and the RGB values? ...