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 693737 - no longer filtering out screenshots
no longer filtering out screenshots
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-13 19:49 UTC by William Jon McCann
Modified: 2013-02-14 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot: Write metadata to png file (2.55 KB, patch)
2013-02-14 17:24 UTC, drago01
committed Details | Review
screenshot: Write metadata to png file (2.61 KB, patch)
2013-02-14 17:34 UTC, drago01
needs-work Details | Review

Description William Jon McCann 2013-02-13 19:49:56 UTC
It seems that once we changed to have the shell save screenshots we broke the filtering them out of the background selector.
Comment 1 Bastien Nocera 2013-02-14 09:19:05 UTC
The metadata isn't written in the PNG files, as gnome-shell uses cairo_surface_write_to_png_stream() which lacks any kind of metadata.
Comment 2 drago01 2013-02-14 13:45:22 UTC
(In reply to comment #1)
> The metadata isn't written in the PNG files, as gnome-shell uses
> cairo_surface_write_to_png_stream() which lacks any kind of metadata.

What metadata do we need?
Comment 3 Florian Müllner 2013-02-14 13:47:57 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > The metadata isn't written in the PNG files, as gnome-shell uses
> > cairo_surface_write_to_png_stream() which lacks any kind of metadata.
> 
> What metadata do we need?

tEXt::Software gnome-screensaver

apparently, see http://git.gnome.org/browse/gnome-screenshot/tree/src/screenshot-application.c#n229
Comment 4 drago01 2013-02-14 17:24:17 UTC
Created attachment 236112 [details] [review]
screenshot: Write metadata to png file

Use GdkPixbuf rather then cairo_surface_write_to_png_stream when saving
screenshots because this allows us to embedded metadata into the file which
is used by the background control panel to filter out screenshots.
Comment 5 drago01 2013-02-14 17:34:58 UTC
Created attachment 236113 [details] [review]
screenshot: Write metadata to png file

Use GdkPixbuf rather then cairo_surface_write_to_png_stream when saving
screenshots because this allows us to embedded metadata into the file which
is used by the background control panel to filter out screenshots.
Comment 6 Cosimo Cecchi 2013-02-14 17:57:57 UTC
Review of attachment 236113 [details] [review]:

Thanks, this makes sense.

::: src/shell-screenshot.c
@@ +194,3 @@
+                                         NULL);
+      if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
+                                         8,

Should use gdk_pixbuf_save_to_stream_async()

@@ +199,3 @@
+        status = CAIRO_STATUS_WRITE_ERROR;
+
+                                         cairo_image_surface_get_stride (screenshot_data->image),

Why this?
Comment 7 Cosimo Cecchi 2013-02-14 17:59:20 UTC
(In reply to comment #6)

> 
> ::: src/shell-screenshot.c
> @@ +194,3 @@
> +                                         NULL);
> +      if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
> +                                         8,
> 
> Should use gdk_pixbuf_save_to_stream_async()

Ignore this, we're in a thread already
Comment 8 drago01 2013-02-14 18:00:49 UTC
(In reply to comment #6)
> Review of attachment 236113 [details] [review]:
> 
> Thanks, this makes sense.
> 
> ::: src/shell-screenshot.c
> @@ +194,3 @@
> +                                         NULL);
> +      if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
> +                                         8,
> 
> Should use gdk_pixbuf_save_to_stream_async()

Why? We are not in the main thread anyway ... doing it async wouldn't gain us anything.

> @@ +199,3 @@
> +        status = CAIRO_STATUS_WRITE_ERROR;
> +
> +                                         cairo_image_surface_get_stride
> (screenshot_data->image),
> 
> Why this?

Why not? Should I hardcode the stride instead?
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-02-14 18:02:20 UTC
(In reply to comment #8)
> Why not? Should I hardcode the stride instead?

Somehow, Splinter had a bug. If you view the review page manually you'll see it was supposed to refer to the mark_dirty call.
Comment 10 drago01 2013-02-14 18:05:04 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Why not? Should I hardcode the stride instead?
> 
> Somehow, Splinter had a bug. If you view the review page manually you'll see it
> was supposed to refer to the mark_dirty call.

Oh ... well because I don't know whether GdkPixbuf messes with the data or not. Even though we do not do anything with the surface later on it feels more correct this way. I can remove it though (actually the first one I attached does not have it).
Comment 11 drago01 2013-02-14 18:08:43 UTC
Comment on attachment 236112 [details] [review]
screenshot: Write metadata to png file

This is the one without the mark_dirty call.
Comment 12 Cosimo Cecchi 2013-02-14 18:13:24 UTC
Review of attachment 236112 [details] [review]:

GdkPixbuf shouldn't touch the passed-in data, so I don't think we should call mark_dirty.
This one looks good to me.
Comment 13 drago01 2013-02-14 18:21:47 UTC
Attachment 236112 [details] pushed as eb5a836 - screenshot: Write metadata to png file