Answer the question
In order to leave comments, you need to log in
Changing the original image. What am I doing wrong?
It is required to change the original image depending on the exposed data.
There is a small sketch:
$image_p;
$filename = "template/assets/images/skins/290.png";
$image_p = imagecreatetruecolor(20, 20);
$image = imagecreatefrompng($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 20, 20, 20, 20);
header('Content-type: image/png');//29 строка
imagepng($image_p);
Answer the question
In order to leave comments, you need to log in
Something was deduced before header('Content-type: image/png');//line 29, I suppose
also check that the file without BOM is saved
If you translate the text of the error from English into Russian, you will know that you are informed that the headers have already been sent to the user before. Search "higher" in the code for calls to output functions (more often this isecho
).
Fixed the problem.
But I have an editable .png file, which means it can have "transparent places"
But imagecreatetruecolor creates a black background
As a result, an undesirable result in the form of a black square is obtained
How can this be fixed?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question