I’m facing error in wordpress on my local server while trying to edin an image, it says “Image rotation is not supported by your web host.” I have a Windows 11 64-bit PC that runs a XAMPP. I need to install a few things on this Apache server via command line, so I’m going to the “shell” option from the
Tag: gd
Keeping a php script active
I was thinking of uploading some huge images onto my webpage and figured I could possibly optimize the load using a special image viewer with zoom functionality. As I’ve understood from long ago is that browsers have certain limits when it comes to image dimensions, and possibly memory as well. The workaround for the simple task of just displaying the
Convert PNG files with transparency to WebP using PHP GD
I have a utility class that loads image files and, among other operations, converts them to other formats. It uses PHP GD. Everything works fine except PNG files that have transparency are done wrong when converting to WebP. The result image has a black background where the transparency should be. This is my code: The class has many other functions
How to write text with opacity on a picture in PHP?
I’m writing a text on a picture. So far everything is fine, but I have to lower the transparency or opacity value of this text. I tried the following methods for the opacity value, but I couldn’t get any results. Actual result : https://prnt.sc/vy8axf Expected result : https://prnt.sc/vy8cnz Answer You could use imagecolorallocatealpha() to assign alpha channel to $textcolor :
Problem pasting one image into another PHP
I want to paste the $original image into the center of $fondo image, i write the following code: The result i got is this: As you can see the cyan color is affecting original image: Any ideas on what i’m wrong? Thank you! Answer the solution is: Creating the image as imagecreatetruecolor instead of imagecreate Then, need to paint the
How to convert a grayscale image to pure black and white in php?
I’m trying to convert a grayscale image to pure black and white in PHP using the GD library. The purpose would be to detect the cervical cells within the image. I’ll leave the PHP code and a MatLab one (I wrote this code in MatLab and I’m trying to obtain the same result in PHP). Basically, I’m having trouble accessing
PHP Resize Uploaded Image To Specific Dimensions Without Cropping
I currently have a script in which users can upload an image file of any dimensions. The uploaded image is sent via ajax to a PHP script where it should be resized and saved to the server. The …
PHP getimagesize – Failed to open stream. Bad request
I am getting the following error: getimagesize(https://static1.squarespace.com/static/570d03d02b8dde8b2642afca/570f74e87c65e4819dec6812/57272dbfb6aa606f78a5d8b5/1470397291105/4XTRYCK3.jpg): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request The image opens without problems in my browser. Does anyone understand why this fails? Answer Squarespace is rejecting any connection where the User-Agent header is not a web browser. This includes CURL and getimagesize. You can set the user-agent header by inserting
Why rand() isn’t really random?
I wanted to put random points on an image (stars in space for some little fun side project) I have this simple script.
Call to undefined function imagecreatefromjpeg() and GD enabled
im working on ubuntu 14.04 LTS with PHP 5.5.9 with GD enabled and i doubled check with but still showing me this msg everytime i try to use imagecreatefromjpeg() Fatal error: Call to undefined function imagecreatefromjpeg() in /../library/image.php on line 34 i even tried to check on it from command line by using this and it gives me back bool(false)