Bug 393113 - Crop Tool: crop image without cropping the layers data
Summary: Crop Tool: crop image without cropping the layers data
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.0.1
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: ddoran3
URL:
Keywords:
: 388254 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-13 19:18 UTC by reptillia39
Modified: 2021-04-14 05:58 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description reptillia39 2018-04-13 19:18:03 UTC
Krita could retain information that are outside a specific image size, so I thought Krita could benefit from an additional function into the crop tool where it crops the canvas instead of the image.
Comment 1 reptillia39 2018-04-13 19:19:58 UTC
Also, I tried putting the status to 'wishlist'. Not working. Where do I report that issue?
Comment 2 Dmitry Kazakov 2018-04-16 13:29:03 UTC
Upgrading the bug to a wishlist

WISHGROUP: Small Usability Fixes
Comment 3 Tiar 2018-06-26 12:34:07 UTC
*** Bug 388254 has been marked as a duplicate of this bug. ***
Comment 4 Storm Engineer 2018-06-28 14:18:37 UTC
This is a feature that has a lot of valid use cases, so I second it.
Comment 5 Victor Wren 2018-10-25 17:43:17 UTC
This has valid uses, but I also depend on the crop tool to get rid of "extra stuff" outside the visible image boundary, so that I'm not saving a lot of image layer information that I'll never use.  Perhaps "image resize" is a better way of accomplishing this? (although the current image resize tool is less than amazing).
Comment 6 Storm Engineer 2019-02-18 13:44:15 UTC
Victor, I don't understand why you want this functionality placed in a different tool when it can simply be a checkbox on the tool settings of the corp tool?

The dialog to change canvas size is nice and all when you do something calculated but doesn't allow simple visual re-composing of the canvas in the way the crop tool would if the checkbox to not discard off-canvas areas is added.
Comment 7 Raghavendra kamath 2019-02-18 14:23:19 UTC
Hi Victor,

To get rid of the content beyond the canvas boundary there is always Image > Trim to Image Size menu. you can also add a keyboard shortcut for that, it seems better for your use case.
Comment 8 Victor Wren 2019-02-19 03:08:38 UTC
(In reply to Raghavendra kamath from comment #7)
> Hi Victor,
> 
> To get rid of the content beyond the canvas boundary there is always Image >
> Trim to Image Size

Thanks!  That is very likely exactly what I'm looking for.  A lot of times in Krita, the functionality has already been anticipated, but finding it is not always the easiest.
Comment 9 ddoran3 2021-04-05 07:26:34 UTC
So I was looking into adding this: Replacing the current functionality is a one line change, but we may want to keep the old image crop.

Perhaps the new one should be added as a new CropType (called Canvas?) (CropType is the drop down menu "Applies to:"). At the moment the CropType drop down is disabled when a raster layer isn't selected, as layer cropping doesn't make sense in that case. Image and the new mode should be selectable at any time, so adding a new CropType would require re-working this.

Adding a simple checkbox is also an option but that checkbox should be disabled when doing a layer crop, so it's not necessarily a lazy solution.

I'd like to hear opinions on how I should proceed.
Comment 10 Tiar 2021-04-05 13:12:31 UTC
@ddoran3:
Hi, please do add a checkbox in Tool Options. There is no need for a new tool and replacing the behaviour would be undesireable. Disabling the checkbox when one is using "Layer" or "Frame" (which exists on master) crop is a good idea.
It's better to have it the least confusing to the end user than having it pretty in terms of the minimal code needed.

Thanks for working on that :) 

(I'm assigning you to the report, please in case you decide that you won't be working on it any more and you can't submit the fix, write a comment here so the bug report will be set to Confirmed again and someone else can start working on it).
Comment 11 Bug Janitor Service 2021-04-12 07:40:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/800
Comment 12 ddoran3 2021-04-14 05:58:41 UTC
Git commit b80b01542a189b5ccbb606bfa0e22c74c733f3ec by Daniel Doran.
Committed on 13/04/2021 at 22:43.
Pushed by dkazakov into branch 'master'.

Add "Canvas" crop mode.
Canvas will change the size of the canvas without cropping any layers.

M  +9    -3    plugins/tools/tool_crop/kis_tool_crop.cc
M  +1    -0    plugins/tools/tool_crop/kis_tool_crop.h
M  +13   -3    plugins/tools/tool_crop/kistoolcropconfigwidget.cpp
M  +5    -0    plugins/tools/tool_crop/wdg_tool_crop.ui

https://invent.kde.org/graphics/krita/commit/b80b01542a189b5ccbb606bfa0e22c74c733f3ec