Working with images in PHP?

Hello, you need to do roughly speaking the generator of avatars, ie a person comes to your site downloads your photo, resized using jCrop Plugin (the trick is this for cropping images as Vkontakte), push save and it should leave the picture where his avatar was placed at the bottom of the template (the template is in PNG format, center, with clear circle, there needs to be avatars of users).Tried to do it using PHP+GD, so an image of the user avatar puts up, and I need to somehow put at the bottom, you are going to say so just swap the places of images, no....the point is that the size of the template png exceeds the size of the avatars, roughly speaking, the avatar size is 300x300, and the template 300х1000, and when I swap the pictures that it is nonsense.
Started to do like everything went fine, at boot had a picture, once it is possible to resize, then click the save button and the output cropped image. But now how to put the avatar under the template ? And how to make so that when clicked saved the picture and not the file .php
July 9th 19 at 13:03
2 answers
July 9th 19 at 13:05
Solution
Here is the library for the desired function.
how to install on open server ? - Winnifred_Harris commented on July 9th 19 at 13:08
: Composer, git or download an archive: https://github.com/Intervention/image - Domenick.Ste commented on July 9th 19 at 13:11
: installed composer, installed Intervantion Image, insert the code and writes the Class 'Image' not found - Winnifred_Harris commented on July 9th 19 at 13:14
: require_once 'vendor/autoload.php'; use Intervention\Image\Image; - Domenick.Ste commented on July 9th 19 at 13:17
: Fatal error: Call to undefined method Intervention\Image\Image::make() - Winnifred_Harris commented on July 9th 19 at 13:20
: Use Manager, as in the example Usage - image.intervention.io/getting_started/installation - Domenick.Ste commented on July 9th 19 at 13:23
: i.epvpimg.com/PMCWc.png all the examples and make - Winnifred_Harris commented on July 9th 19 at 13:26
: sandbox.onlinephpfunctions.com/code/a4146f4db058b0... - Domenick.Ste commented on July 9th 19 at 13:29
thank you very much)) you cool)))) - Winnifred_Harris commented on July 9th 19 at 13:32
: one last question, if I'm going to fill this web-site, I will have to dance with a tambourine to get things set up, or is it already there and everything will work ? - Winnifred_Harris commented on July 9th 19 at 13:35
: if you just poured it shouldn't be a problem. Even if you put zero set of the composer, too, should not be a problem. The main thing that was installed all dependencies. - Domenick.Ste commented on July 9th 19 at 13:38
:understood, thank you very much))) - Winnifred_Harris commented on July 9th 19 at 13:41
: everything seems to work, it remains only an image of the user to move underneath template how to do it ? - Winnifred_Harris commented on July 9th 19 at 13:44
: As in my example, open the background, and it insertia an image of the user. - Domenick.Ste commented on July 9th 19 at 13:47
Although the contrary, but the essence remains the same, first the background then the next image. - Domenick.Ste commented on July 9th 19 at 13:50
: the joke is that the picture should be round( and if I for example put a picture of the user under the background, then the picture is under the background,but the picture itself is the size of the image of the user and must be more) - Winnifred_Harris commented on July 9th 19 at 13:53
: вообщем уже сделал все, вырезал из шаблона квадратик с кружком под размер картинки пользователя, и теперь принцип такой, на картинку пользователя сначала вставляется кусок шаблона с кружком, а потом эта картинка вставляется на общий шаблон....спасибо вам еще раз)) - Winnifred_Harris commented on July 9th 19 at 13:56
: You can open another image, resize it and paste. In the example, insert just and goes the insert. Not sure what happens to round out the picture by using this library, it is better then just using CSS. - Domenick.Ste commented on July 9th 19 at 13:59
July 9th 19 at 13:07
Image Magick
faced with it, but I never found that one image could be placed under another - Winnifred_Harris commented on July 9th 19 at 13:10

Find more questions by tags PHP