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
1 answer

imagecreatefromjpeg() stopped working after upgrading to PHP 7.4 while imagecreatefrompng() and imagecreatefromgif() continue working properly

I'm having this strange with imagecreatefromjpeg() in PHP. It is returning an Uncaught Error: Call to undefined function in one of my scripts without any apparent reason. It's part of a PHP class I wrote and that I am testing. I'm using extensions…
0
votes
1 answer

Yii2 'Your system does not support any of these drivers: gmagick,imagick,gd2'

The problem is like this : i am following a yii tutorial in order to learn more about the framework, the tutorial is https://www.youtube.com/watch?v=whuIf33v2Ug&t=11365s and i found myself strugalling at 2:55:31 ( thumbnail resize ) , i installed…
0
votes
3 answers

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,…
Ali
  • 261,656
  • 265
  • 575
  • 769
0
votes
1 answer

PHP: imagecreatefromstring

I have a file upload class which returns an image resize object if the file upload is believed to be an image. The construct of the image resize class starts with this: $this->resource = imagecreatefromstring($this->getData()); if…
Matt Humphrey
  • 1,554
  • 1
  • 12
  • 30
0
votes
1 answer

gallery file upload problem php

I have this script: if(($_POST['number2'] && !$_POST['button_add']) || ($_POST['number2'] && !$_POST['button_add_gal'])) { $num=$_POST['number2']; for($p=0; $p<$num; $p++) { if ($_POST['page']=='news') { …
Victor
  • 99
  • 1
  • 6
  • 15
0
votes
1 answer

php gd2 thumbnail creator script problem

I have this script: function createThumb($source, $thumb_width=100) { $fl = dirname($source).'
'; $new_name = 'thumb_'.basename($source); $img = imagecreatefromjpeg($source); $width = imagesx($img); $height =…
Victor
  • 99
  • 1
  • 6
  • 15
0
votes
0 answers

a broken image, cant open it in php, how to resolve it? imagecreatefromjpeg():Unsupported marker type 0x22

maybe a broken image, it cant open in php. but it is work in web, emm, any browser. it work in photoshop and image viewer also. please ask it, 1,how to do can be make it work in php also? 2,if cant resolve it, how to hidden error message?…
hhniao
  • 49
  • 8
0
votes
1 answer

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
ipalaus
  • 2,253
  • 4
  • 27
  • 42
0
votes
1 answer

php imagepng not working. shows question marks

I have following problem: imagepng, imagejpeg not working. I Got black question marks(unknown character list) on white screen. gd2 module is on. for example take this simple code: $im = imagecreatefrompng($file_name); header('Content-Type:…
gogagubi
  • 965
  • 1
  • 15
  • 36
0
votes
1 answer

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…
stef
  • 26,771
  • 31
  • 105
  • 143
0
votes
1 answer

install GD2 library php

Looked up some other posts about this. Said to restart apache after modifying ini.php file. my server host won't restart apache like suggests by other users, because it is a shared server. Is there a work around?
0
votes
2 answers

Improving Performance on this Image Creation function

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…
Abs
  • 56,052
  • 101
  • 275
  • 409
0
votes
1 answer

Php imagebmp for monochrome bitmap

How to implement imagebmp() function for monochrome BMP? I found many implementation for 24bit bitmap but nothing about 1bit bitmap.
Tobia
  • 9,165
  • 28
  • 114
  • 219
0
votes
3 answers

Picture display with PHP

I've a problem with some lines of code. I try to generate a picture with php and the gd2 librarie. This code doesn't work.…
moDevsome
  • 189
  • 2
  • 16
0
votes
0 answers

Determining CSS Text width With PHP

I need to determinate text width in my html. I use php GD2 library and calculate text width but calculated width different from chrome developer toolbar width.
Yargicx
  • 1,704
  • 3
  • 16
  • 36