BestImageViewer / geeqie

claiming to be the best image viewer / photo collection browser
http://www.geeqie.org/
GNU General Public License v2.0
466 stars 78 forks source link

Add image Crop functionality #1339

Open IT-Tool opened 4 months ago

IT-Tool commented 4 months ago

Setup (please complete the following information):

Feature request description First of all, thank you for creating and maintaining this great image viewer application.

I wanted to suggest an enhancement that I think would make the application even more useful: the addition of a crop feature.

Currently, the application allows viewing images but doesn't have the ability to crop them. Having a built-in Crop tool would allow users to easily trim unwanted parts from images without needing to use an external editor.

Some suggestions for the cropping feature:

When the user is in full-screen mode, it would be nice to be able to access the crop function by right-clicking (on any part of the image) or by using hotkeys.

Additional context Screenshot example

Thank you for considering this suggestion!

caclark commented 4 months ago

A basic image crop is available in the current release:

Select Edit/Draw Rectangle Use the left-mouse button to drag a rectangle. Select Plugins/Image Crop

A new image is created in /tmp. You can use the new image pop-up menu item Go To Directory View to view in a layout window.

You can use the standard zoom functions to zoom the image, but the rectangle remains the same dimensions. Maybe you want the rectangle to zoom also - but that may be irrelevant as you cannot adjust the rectangle..

This feature works in fullscreen. However, when you use mouse right-click to bring up the pop-up menu and select the Image Crop plugin, the rectangle disappears - but the cropped image is nevertheless created.

You cannot adjust the rectangle in any way. If it is not as you wish, you must redraw.

The plugin requires ImageMagick and exiftool to be installed.

IT-Tool commented 4 months ago

@caclark Thank you for the explanation, I tried it and it does work as you described!

If I may, I would like to share my experience of using it:

  1. Firstly, this is a very non-obvious way to accomplish this task.
  2. Secondly, it is too basic but it could be improved to offer greater comfort.

It's nice that user can assign additional keys to the mouse to speed up this process:

2024-04-25_035456

I'd like to understand another things:

  1. What if I don't need to create a new image (after cropping), but I need to save over the original file. I'm curious to know how to do that. :)
  2. I've noticed that when in full screen mode, cropping images doesn't seem to be working. Additionally, it seems that the mouse pointer isn't visible.

I wonder if there might be a way to improve the user experience in this regard.

caclark commented 4 months ago

I've noticed that when in full screen mode, cropping images doesn't seem to be working. Additionally, it seems that the mouse pointer isn't visible.

If you double-click on the main image, the cursor is not displayed. If you double-click on a thumbnail, the cursor is displayed with a three second timeout on cursor movement. If you use keystroke "F", it depends on your previous action.

This seems to be yet another bug.

caclark commented 3 months ago

What if I don't need to create a new image (after cropping), but I need to save over the original file. I'm curious to know how to do that. :)

That sound a little dangerous to me - but I am a bit careless. Therefore I do not think it would be a good idea to include it as a standard feature.

However, you can edit the Image Crop plugin to work as you wish. Copy the shell script /usr/local/lib/geeqie/geeqie-image-crop to your user area Edit the image crop .desktop file to point to the shell script in your user area Edit the shell script to include something like: cp $tmpdir/$filename-crop.$extension $1

There is no way back from that point....

caclark commented 3 months ago
  1. Rotate the image left or right to align the crop.

I suggest that you use gimp to rotate the image to the required orientation and save it to a temporary file. But if you are using gimp, you might as well use that to crop the image.