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 671614 - Cheese/webcam will not save first taken photo on first opening.
Cheese/webcam will not save first taken photo on first opening.
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
3.2.x
Other Linux
: Normal normal
: 3.6
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
: 687094 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-08 01:31 UTC by changbin
Modified: 2012-11-13 01:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Create the video and photo directories. (1.23 KB, patch)
2012-08-01 03:56 UTC, Shih-Yuan Lee (FourDollars)
rejected Details | Review
show photo thumbnail(s) when photo dir is not created yet. (2.02 KB, patch)
2012-08-30 02:57 UTC, changbin
needs-work Details | Review
updated patch (2.26 KB, application/octet-stream)
2012-09-06 07:44 UTC, changbin
  Details
show first photo thumbnail (1.69 KB, patch)
2012-10-29 13:41 UTC, Debarshi Ray
committed Details | Review

Description changbin 2012-03-08 01:31:48 UTC
1. Open Cheese for the first time.
2. Take a photo. Counter will show the countdown, 3, 2, 1 take photo.
Thumbnail of the photo is not shown, however, the photo file is saved in the file system.
Comment 1 changbin 2012-03-08 01:38:34 UTC
  Cheese uses gfilemonitor to dectect files changes of photo save directory.If photo save directory is not created yet, gfilemonitor has to monitor a missing directory. In lower level(glib/gio), gio checks whether the directory has been created every 4 seconds, if yes, add a watch to detect file changes under the directory. Otherwise, it won’t add watch for the directory.
  When user takes the first photo, cheese will do two jobs in sequence:
  1.Create photo save directory.
  2.Create first photo file. 
  Note that the interval of these two jobs is usually less than 1 second.
  According to above information, it is very possible that(possibility >= 75%) directory and photo file has been created while gio hasn’t add watch for the directory. Thus the create event of first photo file is lost.
Comment 2 Shih-Yuan Lee (FourDollars) 2012-08-01 03:56:00 UTC
Created attachment 220035 [details] [review]
Create the video and photo directories.

Hi,

I made this patch to fix this bug.
Please help to review it.
Any feedback is welcome.

Regards,
$4
Comment 3 Bastien Nocera 2012-08-28 08:37:09 UTC
1. Your system is badly setup, and xdg-user-dirs-update isn't run correctly. The directories should be created on session startup.
2. The patch shouldn't create the directories straight away, but only when needed.
3. 0775 is most likely not the right mode to use
Comment 4 Shih-Yuan Lee (FourDollars) 2012-08-29 02:55:07 UTC
1. My patch is to create ~/Pictures/Webcam and ~/Videos/Webcam. Are they created by xdg-user-dirs-update? I thought they were created by Cheese, but only when first photo or video chip.
2. These two directories are needed by Cheese to put its saving files. Why do we create them when Cheese starts?
3. 0775 is the same permission copied from the same code base in Cheese. To see src/thumbview/cheese-thumb-view.c for `g_mkdir_with_parents (path_videos, 0775);` and `g_mkdir_with_parents (path_photos, 0775);`.
Comment 5 Shih-Yuan Lee (FourDollars) 2012-08-30 02:37:25 UTC
Revising previous comment.
Why don't we create them when Cheese starts?
Comment 6 changbin 2012-08-30 02:57:43 UTC
Created attachment 222908 [details] [review]
show photo thumbnail(s) when photo dir is not created yet. 

As mentioned before, I think root cause is gio problem. please check https://bugzilla.gnome.org/show_bug.cgi?id=671518 for more details.
Here is a work round solution, patch is attached.
Comment 7 David King 2012-09-06 06:27:14 UTC
Comment on attachment 220035 [details] [review]
Create the video and photo directories.

The directories are already created as needed in cheese_fileutil_get_new_media_filename(), and I would rather not duplicate that.
Comment 8 David King 2012-09-06 06:32:02 UTC
Comment on attachment 222908 [details] [review]
show photo thumbnail(s) when photo dir is not created yet. 

Seems reasonable. Can you split adding the prototype into a separate patch and check to see that the logic is still correct with the latest git master version of Cheese, as there were some changes in file monitoring due to the camerabin2 porting.
Comment 9 changbin 2012-09-06 07:44:07 UTC
Created attachment 223608 [details]
updated patch

Rebase patch to latest git trunk.Please kindly help to review. Sorry that I haven't test this patch, since it is really a PITA work to set up build environment for latest Cheese on my old machine. However, the original patch for Cheese 3.2.2 is tested OK before.
Comment 10 David King 2012-10-29 10:47:09 UTC
*** Bug 687094 has been marked as a duplicate of this bug. ***
Comment 11 Debarshi Ray 2012-10-29 13:41:48 UTC
Created attachment 227535 [details] [review]
show first photo thumbnail

Cleaned up Changbin's last patch by removing trailing whitespaces and the function prototype. It is still relevant to Git master.
Comment 12 David King 2012-11-12 21:48:13 UTC
Comment on attachment 227535 [details] [review]
show first photo thumbnail

Pushed to master and gnome-3-6 as commits 8e8f11bc36ade0120cc006acc6d2730ec91248a0 and 8b06d28da36fed275097ee408a0596ee6c387a9a, thanks!
Comment 13 changbin 2012-11-13 01:19:52 UTC
Thanks all, glad to see this bug is finally fixed.