New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autocrop #642

Closed
alphaonex86 opened this Issue Apr 16, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@alphaonex86

alphaonex86 commented Apr 16, 2014

Hello,
As gimp, can you add auto crop to crop the empty (no object, no tile, no image, ...) and useless border.
It's more fast to map than select only the util zone and crop the selected zone.
Cheers,

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Apr 16, 2014

Owner

While this sounds useful, I would personally prefer to implement "auto-growing" functionality instead. But of course auto-crop would be much easier to implement and something I may even have time for eventually.

Owner

bjorn commented Apr 16, 2014

While this sounds useful, I would personally prefer to implement "auto-growing" functionality instead. But of course auto-crop would be much easier to implement and something I may even have time for eventually.

@bjorn bjorn added the Feature label Apr 16, 2014

@bjorn bjorn changed the title from [Features] Add autocrop to Add autocrop Apr 16, 2014

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 17, 2017

Contributor

The simple solution would be to resize the map based on (minX,minY) to (maxX,maxY), right? (Where min and max would be based on extreme coordinates of any placed tile.)

Altough I'm a bit confused as in how this would work when we're using multiple layers.

Contributor

ketanhwr commented May 17, 2017

The simple solution would be to resize the map based on (minX,minY) to (maxX,maxY), right? (Where min and max would be based on extreme coordinates of any placed tile.)

Altough I'm a bit confused as in how this would work when we're using multiple layers.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn May 17, 2017

Owner

Although I'm a bit confused as in how this would work when we're using multiple layers.

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.

Owner

bjorn commented May 17, 2017

Although I'm a bit confused as in how this would work when we're using multiple layers.

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.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 18, 2017

Contributor

Yes, alright. So I'll add an Autocrop option in the same menu where the resize menu is placed. What should be the suitable shortcut key for this, if needed?

Contributor

ketanhwr commented May 18, 2017

Yes, alright. So I'll add an Autocrop option in the same menu where the resize menu is placed. What should be the suitable shortcut key for this, if needed?

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn May 18, 2017

Owner

What should be the suitable shortcut key for this, if needed?

I think it is a quite specific and rare action, so no shortcut is needed. GIMP also doesn't have a shortcut for it.

Owner

bjorn commented May 18, 2017

What should be the suitable shortcut key for this, if needed?

I think it is a quite specific and rare action, so no shortcut is needed. GIMP also doesn't have a shortcut for it.

@bjorn bjorn closed this in ac307f1 Jun 3, 2017

thabetx added a commit to thabetx/tiled that referenced this issue Jun 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment