gd2

Displaying images using PHP not working

I'm trying to display an image using a PHP script. Basically so the php script is passed on the full path to the image, and it then displays that image in the browser. I've checked to make sure the image exists, it is being read correctly, etc, however in the browser i just see the broken image box (e.g the small red cross in IE) if I go...

Errors compiling PHP with GD2 and Freetype on Mac Leopard 10.5.6

I'm compiling PHP5.2.9 on Mac OS X 10.5.6. Need some help to figure this out. I have PHP compiling and working with a basic config, and now I'm trying to compile with GD2. The problem I'm running into is that if I add the argument to build with Freetype, I get build errors. This is my minimum config to demo the problem. Also, I know tha...

PHP GD2, Convert resource image to 24-bit BMP

Hi. I need to convert resource image to 24-bit BMP image with GD2. This code creates 32-bit BMP image, but I need 24-bit. Help please. function imagebmp(&$im) { if (!$im) return null; $w = imagesx($im); $h = imagesy($im); $result = ''; if (!imageistruecolor($im)) { $tmp = imagecreatetruecolor($w, $h);...

How do i resize image file to optional sizes

Hi I have image upload form, user attaches aimage file, and selects image size to resize the uploaded image file(200kb, 500kb, 1mb, 5mb, Original). Then my script needs to resize image file size based on user's optional size, but im not sure how to implement this feature, For example, user uploads image with one 1mb size, and if user ...

How to speed up image resizing in a CodeIgniter PHP application?

I have an application that allows users to upload images. The test case I use is a jpeg of 1.6MB with dimensions 3872 x 2592px. The upload script in the back-end will resize the uploaded image into 6 additional formats: square (small 75 x 75) Small Thumb (50 x 38) Thumb (100 x 76) Small (240 x 161) Medium (500 x 378) Large (1024 x 774)...

How to compress images in CodeIgniter, yet do not change their dimensions?

I have a site where users can upload images. I process these images directly and resize them into 5 additional formats using the CodeIgniter Image Manipulation class. I do this quite efficiently as follow: I always resize from the previous format, instead of from the original I resize using an image quality of 90% which about halves th...

dynamically generating images in PHP sometimes isn't working

I have a page that needs to load several dynamically generated images. Everything works fine 90% of the time, but sometimes some of the images are not generated (I just get the missing image icon instead). Since most of the times it works, and the missing images are not always the same, I think that maybe it has something to do with the ...

Letter placement error with GD2, TTF and PHP

Some time ago I made a script that takes some text and returns it as an image, and worked flawlessly. But I'm not sure since when a weird bug started to happen. The letters that have a (my apologies to the font geeks) "glyph" on the left get pushed to the right so the letter starts on it, but leaves space only for the main letter, hehe, ...

Improving Performance on this Image Creation function

Hello all, I am making use of GD2 and the image functions to take in a string and then convert that into an image using different fonts at different sizes. The function I use is below. Currently, its pretty quick but not quick enough. The function gets called about 20 times per user and the images generated are always new ones (differe...

Are there any libraries (or using GD2 or Image Magick) to allow the upload and processing of EPS or Vector files?

I need to allow for scaling a user uploaded logo to different sizes for different formats, are there any libraries (included or extra) that allow for the procesing of EPS files or high res artwork for this purpose? ...

what is gd image and gd2 images? what are the difference between them?

what is gd image and gd2 images? what are the difference between them? ...

PHP / JS image creation

I'm wondering if this is possible: user uploads a picture which is then presented to him in the browser. The image is placed inside a div that has predefined image as background. User can drag and drop his uploaded image inside the boundaries of this div. It would be something along the lines of uploading a pic of yourself and then pos...

PHP GD2: how to maintain alpha channel transparency and correct gamma

I was intrigued by this discussion of image scaling and subsequently found out that the PHP code I'm using to create thumbnails from uploaded images suffers from the same problem. I decided to try the PHP fix posted near the bottom (converting gamma from 2.2 to 1.0, resizing the image, converting gamma back from 1.0 to 2.2). This works t...

CodeIgniter/PHP/GD2 Image Manipulation is playing up

Hi folks I have a website going that takes a user's uploaded image, and makes three copies - a 'full' copy to print with (downsized to 1500x1125), a 'web' copy to display online (not coded yet), and finally a thumbnail. So here's the code - _imageformat() is passed the parameters (which I've confirmed to be correct) from CI's Upload Cl...

How to isolate only one colour on image with PHP?

Is it possible to leave (isolate) only one colour in image? Currently I'm interested in green:005d00 ...

Resizing a image with PHP and GD2. I'm getting the image and a black background.

I'm creating a dynamic class to generate various images. ImagesUtils.php <?php class ImagesUtils { private $nombre_imagen = null; private $imagen = null; private $extension = null; private $directorio = null; private $width = null; private $height = null; private $tipo = null; private $final_width = nu...