Questions tagged [imagecreatefrompng]

Anything related to imagecreatefrompng PHP function for creating an image from file or URL

imagecreatefrompng is a PHP function that returns an image identifier representing the image obtained from file or URL

109 questions
1
vote
1 answer

scale uploaded image from canvas on webserver with php

my issue is to upload the current canvas not only as a JSON Object in my Database, I also want to save a thumbnail from the canvas. It is for a kind of layout gallery. Nearly everything is working except the scale to e specific size. I used this…
droiddude
  • 177
  • 4
  • 15
1
vote
1 answer

Xampp imagecreatefrompng() producing broken image

I have looked at several other similar questions, but unfortunately none of them have helped with the problem I am having. This is the script.
kira423
  • 325
  • 1
  • 5
  • 26
1
vote
1 answer

php create image and add background image to it

I would like to add an image as the background image to the image that is created by my PHP code
RussellHarrower
  • 6,470
  • 21
  • 102
  • 204
0
votes
1 answer

Merging more than 1 image with a base image

I use this code to merge two images. Can someone please help me to merge 2 source images with 1 base image. For eg. I have these images base.jpg, image1.jpg, image2.jpg. I want to merge image1.jpg and image2.jpg on base.jpg. I'm using this code to…
Anurag
  • 141
  • 1
  • 3
  • 12
0
votes
3 answers

imagecreatefrompng() failed to open stream: HTTP request failed

On my local host this code works well: $im = imagecreatefrompng('BBcode.png'); But when I use the same code in the server $im = imagecreatefrompng('http://lazertag.elitno.net/drupal/BBcode.png'); I got the folloowing error: Warning: …
Alexey
  • 7,127
  • 9
  • 57
  • 94
0
votes
0 answers

PHP 8.1 / imageftbbox Implicit conversion from float to int loses precision

I want to write text onto a PNG, since 8.1 I'm getting a warning PHP Deprecated: Implicit conversion from float 5.5 to int loses precision for line imagefttext($im, 35, 1, $x, $y, $orange, $font, $ausgabecode); The whole…
freakulum
  • 23
  • 4
0
votes
1 answer

How do you generate a tile map with imagecreate from a php upload?

I have an upload form which accepts multiple file uploads. Each file is 32px x 32px and I am trying to generate an image which contains each image in a grid. every row allows for 30 tiles and the column size is calculated based on the amount of…
0
votes
0 answers

Can I retrieve the image created with imagepng() after resizing it before storing it in the folder

I have a code that will resize the image to a specific size and store it in a specific folder. until here everything is working fine. Can I retrieve the image created after resizing it before storing it in the folder, in order to add a watermark to…
Said Erraoudy
  • 1,490
  • 1
  • 13
  • 21
0
votes
1 answer

Create PNG image with background consisting of squares in two colors

i'm tring to create PNG image with background consisting of squares in two colors, the squares is repeated horizontally or vertically as in the picture. This is my code :
Said Erraoudy
  • 1,490
  • 1
  • 13
  • 21
0
votes
1 answer

Oauth2 returned image url breaks imagecreatefrompng

I am using hybridauth-3.7.1 from oauth library. https://github.com/hybridauth/hybridauth/releases The library works perfectly so I have the following:
Bruce
  • 1,039
  • 1
  • 9
  • 31
0
votes
2 answers

How can I resize an image with PHP in the following code?

I am working on an image upload and using PHP in order to save the file on server. I want to resize the image to 256px x 256px and I am using the following code but the final image is not 256px x 256px May someone offer any suggestions? …
arkitektron
  • 81
  • 1
  • 1
  • 7
0
votes
0 answers

Certificate not showing in localhost i.e. imagecreatefromjpeg() not working

I want to create certificates for users on my website but following code isn't working and only showing grey square when loaded on…
0
votes
0 answers

PHP imagecreatefrompng() : failed to open stream

With the same code on two different web server I found two different results ! I use PHP7.3 fpm on both. The file path is something like "http://fitantanana/viewimage.php?modulepart=medias&entity=1&file=image/test_Exemple_doc.png" On the server…
0
votes
1 answer

PHP increase chunk data size for an image

I have an PNG image stored inside a variable. The file is not corrupted, but big (26,7mb / 2908x3444 pixels). I want to load the image and have already used imagecreatefromstring on many other images. But on this image it fails with "zTXt: chunk…
Vidarrus
  • 175
  • 4
  • 18
0
votes
1 answer

imagecreatefrompng() doesn't recognize the dynamic path

I want to dynamically open a PNG image, but imagecreatefrompng() behaves oddly. If I provide an explicit path like: $our_image = imagecreatefrompng("https://example.com/customfiles/avatars/avatar2.png"); it works perfectly, but if I try to submit a…
user15933
  • 11
  • 5