Questions tagged [php-gd]

The PHP GD class contains built in image manipulation for PHP versions 4.3 and up.

The PHP GD class contains built in image manipulation for versions 4.3 and up. This class is commonly used for:

  • Adding filters to images
  • Adding watermarks to images
  • Changing image size for upload
  • Outputting an image to the buffer
  • Creating images on the fly (e.g. captcha verification)

A download of the library can be found at https://bitbucket.org/pierrejoye/gd-libgd/downloads

370 questions
0
votes
2 answers

PHP GD Library Images Not Showing For Some Users

I run a virtual pet website and we use the PHP GD Library to produce our Avatars and Pets. We have over a thousand users so far, and out of that only 3 users have had this issue. For each user though, it's the exact same issue. Here is a screenshot…
0
votes
2 answers

Is there any php function that returns an image handle so that i can use it in img src html tag?

I tried this imagejpeg() php method, but it returns an image to a browser on running the code. However I need a method that returns an image URL so that i can use it in my img tag. Currently i have to use - but…
swapnesh
  • 26,318
  • 22
  • 94
  • 126
0
votes
1 answer

imagecreatefromjpeg parameter not working

I have used imagecreatefromjpeg("1.jpg") it is showing Warning: imagecopy() expects parameter 1 to be resource, string given in E:\wamp\www I am not understanding why it is not working and it tacks as a string, though it is a existing image name…
Bidyut
  • 539
  • 2
  • 8
  • 17
0
votes
3 answers

Barcode generation and decoding in PHP

I need to develop a PHP application that will be generating barcodes and also will have the ability to read those barcodes back. As my application will be a web based application and underlying technology is PHP which is a server side scripting…
Tahir Yasin
  • 11,489
  • 5
  • 42
  • 59
0
votes
1 answer

Rotate image on top of background-image

I have two images. one is a jpg image of a rotated polaroid frame polaroid.jpg. The other is just an ordinary image image.jpg. I'm trying to rotate the image, and then put it on top of the polaroid-image, and then show the merged images as one…
Jules Colle
  • 11,227
  • 8
  • 60
  • 67
0
votes
2 answers

How to rotate image repetitively in php without increasing its file size

I am currently using imagerotate() available in php GD to let user rotate images. Whenever user rotates like 45 degree, 75 degree etc, background color is added to make image have rectangle shape. The more the number of time user rotates,the bigger…
ATZ
  • 353
  • 2
  • 7
  • 18
0
votes
1 answer

How to add image resize to my move_uploaded_file if else statement in php?

The if else state is as follows: if ( isset( $_POST['submit'] ) ) { $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] ==…
Tony
  • 315
  • 1
  • 4
  • 13
0
votes
1 answer

How to adjust exposure of an image in php gd

I read that exposure is the amount of light allowed to fall on each area unit of a photographic medium (photographic film or image sensor) during the process of taking a photograph, according to wiki. I am not from image processing background. So,I…
ATZ
  • 353
  • 2
  • 7
  • 18
0
votes
1 answer

Image flipping using php

I am provided with a hosting plan with php gd version 2 and I cannot install any other library. I know image flipping can be done by using imagesx() imagesy() and imagecreatetruecolor() but they are not available in GD version 2. and I cannot…
ATZ
  • 353
  • 2
  • 7
  • 18
0
votes
2 answers

Php gd how to display image for each user without saving

I want a help,I created a facebook app using php gd.The program is when user open the app a image will appear.The image contains the username of the user,the profile pic and random generated nick name.Iam saving the output image to the server as…
Jijo John
  • 1,375
  • 9
  • 21
0
votes
3 answers

Adding watermark with PHP

This is my PHP water-marking function: function img_watermark($image) { $stamp = imagecreatefrompng('images/wm.png'); $im = imagecreatefromjpeg($image); $marge_right = 10; $marge_bottom = 10; $sx = imagesx($stamp); $sy =…
mcan
  • 1,914
  • 3
  • 32
  • 53
0
votes
1 answer

Modern PHP: can GD be implied?

PHP does not have built-in image editing capability, but many projects use the GD library and the servers I work on have this already installed. I am distributing an open source product, Camera Life, which lets people manage their photos in a…
William Entriken
  • 37,208
  • 23
  • 149
  • 195
0
votes
1 answer

Image as isosceles trapezoid PHP GD

i have this function that transforms image to trapezoid using PHP GD: function perspective($i,$gradient=0.9,$rightdown=true,$background=0xFFFFFF) { $mult=3; $w=imagesx($i); $h=imagesy($i); …
SomeoneS
  • 1,207
  • 2
  • 19
  • 34
0
votes
2 answers

Fatal error trying to allocate memory when creating thumbs

I want to share something that happened to me on the way. I uploaded an image to my website and after that I created some thumbs. Those thumbs where being cropped automatically from relatively big files (jpeg images of about 5mb), and I was doing…
Sergi Juanola
  • 6,531
  • 8
  • 56
  • 93
0
votes
1 answer

Rotate big size image gives error in php

When I am rotating small images by rotateImage() function then its working fine.But in case large file (5500 X 3000px) it gives error. How we handle large images in php. // Content type header('Content-type: image/jpeg'); // Load $source =…
Saurabh
  • 148
  • 1
  • 10