Join GitHub today
Add autocrop #642
You could just go through all layers and compute min/max based on that, but that won't work very nicely when in the future we decouple layer size and tile size from the map.
But, I just checked what GIMP does and actually it crops the image only based on the currently selected layer. So, surely that is acceptable behavior as well.
Then, the only remaining question is how to treat object layers. We could either just not support this option for now, or determine the boundaries of the objects on the current object layer and then somehow mapping that also to any potential tile layers. I think at first we could just disable this action when an object layer is selected.