Today i was in need of a basic image slicer. An there must be a million of these things out there. But i wanted to see how hard / easy it would be to create this myself.
I started with a div.
Then i added the placeholder for the to be scaled image. And a div that will represent the slicer borders.
The next thing to do is setup the scaling canvas. So let’s make it draggable and resizeable.
The result is a nice red dotted line (square) on top of the image. The dotted area is draggable and resizeable.
When the right slice is selected just hit the slice button and PHP/GD will do the rest.
That’s all. All files can be downloaded here