Questions tagged [gd2]

GD2 as well as GD are open source code libraries for the dynamic creation of images by programmers. GD2 is the improved version of GD and a widely used standard. For example, GD2 in included in PHP 5.

GD2 as well as are code libraries for the dynamic creation of images by programmers. GD2 is the improved version of and a widely used standard. For example, GD2 in included in .

Useful Links:

109 questions
0
votes
2 answers

return dynamic image zf2

I use zend framework 2 and try to return an created with gd2 library jpeg image . but it doesn't work. could you look my code what's the problem? My code is run with plain php in normally but in zf2 problem? class PictureController extends…
Yargicx
  • 1,704
  • 3
  • 16
  • 36
0
votes
1 answer

Why is Content-Type: image/jpeg header not working?

I'm using GD library to resize image. Why is not header('Content-Type: image/jpeg'); working? It gave me an error as you can see in pic below: Here are my GD details: .
sopanha
  • 345
  • 3
  • 11
0
votes
1 answer

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…
A. M.
  • 580
  • 1
  • 8
  • 21
0
votes
1 answer

how to crop and receive two images after the original image has been uploaded using codeigniter

I created a library that just uploads 1 image, crops it given the path, width, and height. But i cant figure out how I can have it crop as many images as i want and return an array of all the filenames it created. Here is my library, let me know if…
Exploit
  • 6,278
  • 19
  • 70
  • 103
0
votes
2 answers

Resize image according to width only & crop Extra Height , Codeigniter

I need to resize my images according to width only , not height :( since i am using ** $config['maintain_ratio'] = TRUE;** , codeigniter solves it automatically (thats the problem) sometimes i get a black solid as an extra width or height , i…
Fahad
  • 1,943
  • 22
  • 27
0
votes
2 answers

Unsupported image format

I've got a problem here which keeps appearing with a message that says "Unsupported image format" First I tried to resolve this issue and it was seem to be fixed but today when I hit the page same errors appeared. Before I resolved it by updating…
Mthe beseti
  • 599
  • 1
  • 10
  • 29
0
votes
1 answer

How to debug: "HEADER ALREADY SENT" and GD2?

I have an annoying HEADER ALREADY SENT error. It is not easy to debug it, what I could do was to improve the logging to isolate the source of the issue (has described here): Cannot send headers; headers already sent in…
WonderLand
  • 5,494
  • 7
  • 57
  • 76
0
votes
1 answer

Image Manipulation library will not create a thumbnail

I have created a library file that manages gallery functions, when a user uploads an image. This code will not create a thumbnail - it tries to resize the original image - am i missing something obvious? private function…
Chris Mccabe
  • 1,902
  • 6
  • 30
  • 61
0
votes
1 answer

GD2 - Copying two transparent images results in black background

This is blowing my mind. I want to merge 2 transparent PNGs. One is a circle ($source) generated on the fly from a square image. The second is a map marker ($marker) with a transparent circle to fit the first behind. imagepng($source); and…
Bruno
  • 31
  • 4
0
votes
2 answers

Calculating Crop Coordinates

I am trying to figure out how to calculate the cropping coordinates for the full size image from a much smaller image, lets say the full size image is 1775 x 2664, the image that the user sees on the cropping page (uses jCrop) is 533 X 800. The…
0
votes
2 answers

How do i resize image file to optional sizes

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…
taras
  • 2,223
  • 5
  • 36
  • 43
0
votes
1 answer

file_put_contents give me a specific error

I am developing a project using CodeIgniter. When I try to download an image from remote server, I get the fallowing error: ERROR: Message: file_put_contents(): supplied resource is not a valid stream resource The code that causes error: …
Onur
  • 414
  • 1
  • 11
  • 31
0
votes
0 answers

screen effect with gd2

Is it possible to insert watermark to another photo with screen effect (similar like in Photoshop) using PHP with gd2? I was looking for something like that in PHP manual and google, but I only found imagelayereffect and imagefilter function and…
0
votes
1 answer

PHP Image Creation failing

I've made a script that creates an image using imagecreatetruecolour(). It then adds a letter to the image using the imagettftext() function. Some other changes are made and finally the white background is removed and it saved as a PNG file. The…
wezternator
  • 167
  • 1
  • 1
  • 8
-1
votes
1 answer

Enable GD support on PHP 7.2 in a Ubuntu 18.04

I need to enable GD support on PHP 7.2 in a Ubuntu 18.04 installation and I've found this solution on the web: sudo apt-get install php7.2-gd Since I'm not an expert and I'm worried about the already running configuration files, I have to ask if…
luix10
  • 49
  • 8