gd

How to avoid black background when rotating an image 45 degree using PHP?

Hi I have to flip a thumpnail image before merge it with another jpeg file. but when I rotate 45 degree using php. It shows a black background. how can I avoid that. any body can help me. ...

How to rotate image completely. with out showing the black portion.

I have an image I have to rotate that image 25 degree. if I rotate it shows some black background. How can I avoid that. How can I rotate image completely with out showing the black portion by using PHP GD. I cant use js for rotation. because I have to merge the image with another one after rotation. any body have the scripts for this pl...

How to create thumbnail images with white 3px border using PHP?

How to create thumbnail images with white 3px border using PHP? any body have the scripts please help me :( ...

Which PHP image processing library is more powerful,imagick or gd?

And the reason? ...

PHP+GD creating random black thumbnails

Hello, This function is creating some random black images like.. 10% of the time, is not much, but.. you know.. shouldnt be happening. class ImgResizer { private $originalFile = ''; public function __construct($originalFile = '') { $this -> originalFile = $originalFile; } public function resize($newWidth, $targetFile) { if (empt...

GD PHP Base64 Picture (png) error

This is part of my code: $con = mysql_connect("localhost","username","passs"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); if(mysql_num_rows(mysql_query("SELECT name FROM xbox_user WHERE name = '$user'"))){ // Code inside if block if userid is already there $result = mysql_q...

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? ...

IMagic object creation shows error?

I just try to integrate ImageMagick into my PHP project. I installed and just execute the sample files that they provided with the imagick-3.0.0RC1 zip file. But it shows Fatal error: Class 'Imagick' not found in C:\wamp\www\imagick-3.0.0RC1\imagick-3.0.0RC1\examples\watermark.php on line 9 this kind of an error how can I avoid that. ...

Stop multiple sessions accessing the same file simultaneously

Is it possible to lock a file to stop it being opened while GD library is accessing it? What I am looking to achieve is similar to a database 'serialzable' level of isolation... I want to ensure that only one session/user can access an image at a time to stop a 'dirty read'. My application allows users to add an image of choice to a b...

How to install imagemagick on windows 7

How to install image magic at windows 7. I followed these instruction To install IMagick on windows xp (php 5.2.x) 1.) download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ ImageMagick-6.5.8-7-Q16-windows-dll.exe 2.) download php_imagick_dyn-Q16.dll from: http://valokuva.org/outside...

How do i use a transparent image in a transparent image using GD?

I have tried every way I can find but the background is always black. Is there any way to keep the transparency of the first image when GD ises it in PHP? I'm using imagecopymerge to use the image. though i am not sure if this is the right way. imagecopymerge($dest, $char, 0, 0, 0, 0, 150, 300, 100); The image is like so: http://file...

PNG composition using GD and PHP

I am trying to take a rectangular png and add depth using GD by duplicating the background and moving it down 1 pixel and right 1 pixel. I am trying to preserve a transparent background as well. I am having a bunch of trouble with preserving the transparency. Any help would be greatly appreciated. Thanks! $obj = imagecreatefrom...

Duplicate a image varible GD library

What is the easiest way to duplicate an image variable in PHP. Normally you can simply do $varnew = $varold. But with a GD library variable if I did the above and then edited $varnew then $varold would be effected too. Obviously one way would be to reopen the file or to make a new image and copy it into it. Is there an easier way? ...

Why does my Image stretch when I crop it?

I am using the following code snippet in order to crop a image? function crop($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $this->getWidth(), $this->getHeight(), $width, $height ); $this->image = $new_image; } Here, $this->imag...

how do i create a transparent canvas, then add transparent pngs to it?

i need to create a transparent image, then combine transparent pngs to it whilst maintaining image quality. how can i do this? imagecreatetruecolor(...); //processing using imagecopymerge(..); imagepng(...); outputs a black background. thanks :) here's my actual code for reference... $d = getimagesize(TMP.$this->files[0]);...

JS: Image upload live manipulation, scale, dimensions and crop

I am creating a CMS which has a number of images which a user can upload and attach to various places in the pages. I am trying to find a nice, preferably jquery based plugin or similar for scaling an image before allowing it to be cropped. I have implemented jCrop http://deepliquid.com/content/Jcrop.html which is working great. Howeve...

PHP GD: need to find out an alpha quantity

Imagine this. I have a pixel of color (255,0,0) [red]. No someone painted on it with white color with * alpha. I know the background color, I know with what color it was painted over, I need to get the alpha of the painted over color. How? So far we have: $im = imagecreatefrompng('public/images/bg-tmp.png'); // we need to find a neare...

better image quality for gif with gd library in PHP

Hello, i create a transparent gif with text with the gd library but the output quality of the Text isn't good. Has anybody an idea how can i improve the quality? Here is the code: $req = explode('|', $_REQUEST['r']); $text = $req[0]; header ("Content-type: image/gif"); $font = getFont($req[2]); $font_size = $req[1]; ...

imagejpeg() doesnt give the output properly in php

Hi there, I want to upload an image from disk, resize it, and then upload it to Amazon S3. However, I cant get the proper image output from imagejpeg(). heres my code: $sourceUrl = $_FILES['path']['tmp_name']; $thumbWidth = '100'; $thumbid = uniqid(); $img = imagecreatefromjpeg($sourceUrl); $width = imagesx( $img ); $height =...

textelements with transparent background php gd

Hello, i would like to create text on a transparent gif background with php and the gd library like this: http://www.gutscheinvordrucke.de/kulinarisch/candlelight-dinner.html But in my application, the text hasn't a good quality. Does anybody know the best practice like in the posted link? Here is my code to create textarea with a tra...