As it is easy to crop an image with .uno:Crop, it would be good to have an easy means of resetting the image to its uncropped state. In order not to expand the menu, a Crop/Uncrop submenu could be created to house both entries. It might also be useful to house .uno:GrafAttrCrop (crop in a dialog) as well.
I agree. status NEW
The uno command can be .uno:Uncrop and it should check if an image's left, right, top or bottom values are not 0.00 and if so the command should reset them all to 0.00 else the command should be disabled.
would be also useable in the image dialog window in the crop tab to say uncrop image to default setting.
Please add keyword 'needsUXEval' and CC 'libreoffice-ux-advise@lists.freedesktop.org' if input from UX is needed.
A homeless couple with a 9-month-old baby, who are both on the Section 8 housing voucher program and live in a motel room in San Diego, California, are getting married this weekend. The bride-to-be is 26 years old, and she and her husband have been living at a motel for about five months. The groom is 30 years old and has been homeless for about two years. He was previously married but his wife left him after he lost his job several years ago. https://sectionpedia.com/section-8-housing/ The pair met at a grocery store where they were both shopping for food stamps. They started dating and had their first child together while they were using public assistance programs to help pay for food, shelter and clothing for themselves and their daughter. They say they love each other very much, but they are worried about what will happen when they receive $700 in federal aid per month to help cover the costs of their motel room and utilities.
Moving keywords from duplicate. See also more general suggested UNO command in bug 100344.
*** Bug 138812 has been marked as a duplicate of this bug. ***
Important comments from duplicate: ---- Heiko in bug 138812 comment 4: Let's realize the uncrop function, add a button to the dialog and a UNO command for customization. I tend to agree with Telesto that uncrop inn the context menu is desirable - but please only if crop has been applied. The dialog is cui/uiconfig/ui/croppage.ui, for code inspiration search for SID_ATTR_GRAF_CROP ---- Hossein in bug 138812 comment 11: Re-evaluating the EasyHack in 2022. This enhancement is still relevant. As per comment 2 and comment 3, I think it would be good to have "Reset Crop" both in the dialog and right click context menu.
Important comments from duplicate: ---- Heiko in bug 138812 comment 4: Let's realize the uncrop function, add a button to the dialog and a UNO command for customization. I tend to agree with Telesto that uncrop in the context menu is desirable - but please only if crop has been applied. The dialog is cui/uiconfig/ui/croppage.ui, for code inspiration search for SID_ATTR_GRAF_CROP ---- Hossein in bug 138812 comment 11: Re-evaluating the EasyHack in 2022. This enhancement is still relevant. As per comment 2 and comment 3, I think it would be good to have "Reset Crop" both in the dialog and right click context menu.
Andrea Rosetti committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/826300d55b8f18593c4b56fb448d09fac52820bd tdf#86628 Add reset crop function to dialog It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Andrea for this. I tested in: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 16d43b7c5396d6382926d514dc9ce10b3ce94cba CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded However, I think there is an issue with it. In my opinion, it should restore the original size as well. I am aware your commit message says the Oiginal Size button should be used if we also want to restore the size, but it restores the original size _of the file_, not the size the image had before cropping. Furthermore, I think most users' expectation will be that undoing a crop does not keep the cropped size and affect the aspect ratio. Heiko, do you agree this needs fixing?
(also note that there is support for removing size and scale controls from the overcrowded Crop tab: bug 143037)
(In reply to Stéphane Guillou (stragu) from comment #11) > ...it should restore the original size as well. The patch is very simple and just resets the left/right/top/bottom values to zero. Not sure what exactly you have in mind with resize, could be after compress/save where maybe the original size is not available or you mean the spin edits in the same tab- which is, IMO, clearly unrelated to "reset crop" at the "Crop" frame.
Created attachment 191572 [details] sample ODT with image to crop and reset (In reply to Heiko Tietze from comment #13) > The patch is very simple and just resets the left/right/top/bottom values to > zero. Not sure what exactly you have in mind with resize 1. Open sample ODT 2. Crop the image horizontally to about half 3. Right-click > Properties > Crop > Reset Crop > OK Result A: squished picture. 4. Undo 5. Right-click > Properties > Crop > Reset Crop AND Reset Size > OK Result B: because the picture was scaled automatically to fit the page when imported, this workaround still doesn't work. (It _would_ work for a smaller picture that could fit on the page without scaling when it was imported.) Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 0cd74b5be297f638d455b9b267462192f2e6620c CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded
Andrea, changing the individual crop parameters trigger the CropModifyHdl (and adjust the original size by that). Please have a look and perhaps just call this method in UncropHdl.