How to make a single picture (PNG/JPG) from a know number of pictures on PHP? -


I have an array in PHP, which contains the image url (jpg pics). When you implement php scripts This array is filled with images url (lets say 4 pics for this example). At this point I want to distribute the pictures equally in space and generate a single such as: alt </ Div> <p> <div class =

  1. Hold all the images in the array
  2. Two of the largest dimensions Find
  3. Make a canvas that can fit 4 images covering an area of ​​two largest dimensions of the product, i.e. height = maxw * 2 and width = maxx * 2.
  4. Canvas, you can easily use maximum dimensions as a guide here:
    1. x = MAXX / 2 + image 1 width / -2, y = maxhew / 2 + Image 1 height / -2
    2. x = maxx + (maxx / 2 + image 2 width / -2), y = maxwy / 2 + image height 2/2
    3. X = maxx / 2 + image 3 width / -2, y = maxY + (maxiwy / 2 + image 3 height / -2)
    4. x = maxx + (maxx / 2 + image 4 width / 2), Y = MaxY + (Maxw / 2 + image 4 o Save / Save
    5. You want to scale down to a set maximum, in which case you To present the multiplier of a scale in the equation,

      keyword: ,,.

You also want to crop in a square shape, thereby reducing the space induced by the pictures of different aspect ratios.

Comments