0

I looked around for an app that could make a wallpaper out of my music library album art but I did not found one that could do even remotely what I wanted. So, instead, I built one in PHP. This script scans a folder for all the mp3 inside it then creates a tile wall out of the scrambled album covers. The output looks like this. It is made out of a wrapper div with a div for every album art inside it as a background.
The problem I'm facing is that I don't know how to convert all these images into one single image.
Is there any way I can convert this div into a single image, or maybe convert this div to a canvas and then save it as an image?

Attached image enter image description here

Roopendra
  • 7,674
  • 16
  • 65
  • 92
Valmir Junior
  • 596
  • 6
  • 10

1 Answers1

0

Maybe you should forget your div, create an empty image with GD and add all your album covers one boy one : http://www.php.net/manual/en/book.image.php

sylvhama
  • 251
  • 1
  • 4
  • 13
  • Some kind of Example would be nice, if you know something ;) – demonking Dec 11 '13 at 05:44
  • I never did that before but I would try to create an empty image with the dimensions of your wallpaper : [imagecreate](http://www.php.net/manual/en/function.imagecreate.php) I would load all your covers in a loop (use an array with their path). [imagrecreatefromjpeg](http://www.php.net/manual/en/function.imagecreatefromjpeg.php) For each cover, you can draw a cover inside the wallpaer. x will be equal to previous x + cover width, y will be equal to previous y + cover height (at the end of the line). [imagecopymerge](http://br2.php.net/manual/en/function.imagecopymerge.php) – sylvhama Dec 11 '13 at 07:34