After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760931 - Cropping not being applied after clicking "Done"
Cropping not being applied after clicking "Done"
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.19.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-01-21 13:02 UTC by Rafael Fonseca
Modified: 2016-02-17 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
edit: Move "edit-done" implementation to photos-preview-view.c (4.50 KB, patch)
2016-02-03 04:53 UTC, Umang Jain
none Details | Review
edit: Deactivate current tool before saving the pipeline (921 bytes, patch)
2016-02-03 05:11 UTC, Umang Jain
needs-work Details | Review
edit: Move "edit-done" implementation to photos-preview-view.c (4.51 KB, patch)
2016-02-06 07:06 UTC, Umang Jain
committed Details | Review
edit: Retract the currently activated tool before saving the pipeline (1.03 KB, patch)
2016-02-06 11:09 UTC, Umang Jain
committed Details | Review
application, preview-view: Move the "edit-done" implementation (5.08 KB, patch)
2016-02-08 14:02 UTC, Debarshi Ray
committed Details | Review
preview-view: Deactivate the current tool before saving the pipeline (894 bytes, patch)
2016-02-08 14:03 UTC, Debarshi Ray
committed Details | Review

Description Rafael Fonseca 2016-01-21 13:02:50 UTC
If you try to only crop a photo, clicking Done won't work. These are the steps to reproduce the problem:

 Open gnome-photos -> Select Picture -> Click edit -> Click crop -> Select crop area -> Click Done ==> no cropping

To make it work:

 Open gnome-photos -> Select Picture -> Click edit -> Click crop -> Select crop area -> Change to Colors ==> cropping done
Comment 1 Umang Jain 2016-02-03 04:53:29 UTC
Created attachment 320312 [details] [review]
edit: Move "edit-done" implementation to photos-preview-view.c
Comment 2 Umang Jain 2016-02-03 05:11:28 UTC
Created attachment 320314 [details] [review]
edit: Deactivate current tool before saving the pipeline
Comment 3 Debarshi Ray 2016-02-05 12:11:39 UTC
Review of attachment 320312 [details] [review]:

Thanks, Umang. This is in the right direction.

::: src/photos-preview-view.c
@@ +511,3 @@
+  item = PHOTOS_BASE_ITEM (photos_base_manager_get_active_object (self->item_mngr));
+  if (item == NULL)
+    return;

Umm... why did you not use 'g_return_if_fail (item != NULL)' as before? If item is NULL, then it should be marked as a CRITICAL because it would indicate a programming error, not a runtime condition that we should cleanly handle. It would be programming error because logic dictates that there must be an active item if we activated 'edit-done'.
Comment 4 Debarshi Ray 2016-02-05 12:20:40 UTC
Review of attachment 320314 [details] [review]:

::: src/photos-preview-view.c
@@ +514,3 @@
 
+  /* Deactivate the current tool before saving the pipeline. */
+  photos_preview_view_tool_changed (self, NULL);

I think it would be better to retract the tool also. You can use photos_edit_palette_hide_details, and that will take care of calling photos_preview_view_tool_changed.

If this affects the hiding animation too much, then we can think of sliding the entire palette upwards, like we do when entering the edit mode, as the final step after the pipeline is saved.
Comment 5 Umang Jain 2016-02-06 07:06:38 UTC
Created attachment 320521 [details] [review]
edit: Move "edit-done" implementation to photos-preview-view.c
Comment 6 Umang Jain 2016-02-06 08:02:11 UTC
(In reply to Debarshi Ray from comment #4)

> 
> If this affects the hiding animation too much, then we can think of sliding
> the entire palette upwards, like we do when entering the edit mode, as the
> final step after the pipeline is saved.

Sorry but I didn't get exactly what you are trying to say, like I don't see palette sliding upwards when we "ENTER" the Editing mode. But I do see, palette row sliding upwards while flipping them.

Basically, I am  going to change :
+  photos_preview_view_tool_changed (self, NULL);

with

photos_edit_palette_hide_details (PHOTOS_EDIT_PALETTE (self->palette));

It looks good to me. Please review it and I'll see what part I am not able to understand.
Comment 7 Umang Jain 2016-02-06 11:09:32 UTC
Created attachment 320528 [details] [review]
edit: Retract the currently activated tool before saving the pipeline
Comment 8 Debarshi Ray 2016-02-08 14:01:32 UTC
Review of attachment 320528 [details] [review]:

This looks nice.

::: src/photos-preview-view.c
@@ +511,3 @@
   g_return_if_fail (item != NULL);
 
+  /* Retract the currently activated tool before saving the pipeline. */

Nitpick: the comment is not necessary. :)
Comment 9 Debarshi Ray 2016-02-08 14:01:35 UTC
Review of attachment 320521 [details] [review]:

Thanks, Umang. This is much better.

::: src/photos-preview-view.c
@@ +513,3 @@
+  app = g_application_get_default ();
+  g_application_hold (app);
+  photos_base_item_pipeline_save_async (item, NULL, photos_preview_view_edit_done_pipeline_save, self);

Thinking about it, we should take a ref on self during the lifetime of the pipeline_save_async operation. It was not necessary when this lived inside PhotosApplication because the hold would take care of it.
Comment 10 Debarshi Ray 2016-02-08 14:02:37 UTC
Created attachment 320628 [details] [review]
application, preview-view: Move the "edit-done" implementation
Comment 11 Debarshi Ray 2016-02-08 14:03:04 UTC
Created attachment 320629 [details] [review]
preview-view: Deactivate the current tool before saving the pipeline
Comment 12 Debarshi Ray 2016-02-08 14:03:26 UTC
Thanks for the nice patches, Umang.