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 747557 - zbar: Get an image along with the barcode
zbar: Get an image along with the barcode
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 1.5.1
Assigned To: Reynaldo H. Verdejo Pinochet
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-09 13:00 UTC by Tobias Mueller
Modified: 2015-05-31 23:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
zbar: add frame sample to barcode message (1.95 KB, patch)
2015-05-02 03:18 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
zbar: add frame sample to barcode message (4.86 KB, patch)
2015-05-29 17:39 UTC, Reynaldo H. Verdejo Pinochet
reviewed Details | Review

Description Tobias Mueller 2015-04-09 13:00:24 UTC
I am using the zbar element and I would like to "catch" the image that
made zbar decode a barcode.
So I do not only want to get the decoded barcode, but also the image
which caused zbar to generate a signal.

The scenario is that an attacker could "inject", for a frame or two, a
malicious image. And I want to show the user "see, this image apparently
contained a barcode which decoded to this string".
Comment 1 Nicolas Dufresne (ndufresne) 2015-04-22 16:56:53 UTC
My suggestion would be to attach a GstSample to the message. Looks like a good enhancement.
Comment 2 Reynaldo H. Verdejo Pinochet 2015-05-02 03:18:01 UTC
Created attachment 302748 [details] [review]
zbar: add frame sample to barcode message

Quickly drafted but should work. Tobias, can you
check and report back please?
Comment 3 Tobias Mueller 2015-05-09 16:24:32 UTC
Seems to work. Thanks!  I'm in the process of figuring out how to actually display the pixbuf nicely, but I think GStreamer's job is done.  Thanks!
Comment 4 Tim-Philipp Müller 2015-05-28 14:22:29 UTC
Patch looks fine, but I wonder if this should be made opt-in and conditional on a separate property, mostly because you might end up with a whole bunch of frames 'stuck' on the bus.

It depends a bit how often a message is posted for the same code I guess. I did not check what the default behaviour is in that case.
Comment 5 Nicolas Dufresne (ndufresne) 2015-05-28 14:40:52 UTC
From what I see, I think it's posted often enough to add a property to opt this in indeed.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-28 14:51:52 UTC
+1 for opt in. Otherwise sounds like a good idea.
Comment 7 Reynaldo H. Verdejo Pinochet 2015-05-29 17:39:35 UTC
Created attachment 304280 [details] [review]
zbar: add frame sample to barcode message

Updated patch adds attach-frame property to control behavior
Comment 8 Tim-Philipp Müller 2015-05-29 17:52:13 UTC
Comment on attachment 304280 [details] [review]
zbar: add frame sample to barcode message

Thanks, looks good! Two small nitpicks:

 - could you add "(Since 1.6)" in the property description and/or a gtk-doc chunk for the property with a "Since: 1.6"?

 - create the structure with the common fields and then do:

     if (zbar->frame_attach)
       gst_structure_set (s, frame", GST_TYPE_SAMPLE, sample, NULL);

Feel free to push then.
Comment 9 Tim-Philipp Müller 2015-05-29 17:53:37 UTC
>      if (zbar->frame_attach)
>        gst_structure_set (s, frame", GST_TYPE_SAMPLE, sample, NULL);

That's more code in practice of course, all I meant was that the structure is just created once with the common fields.
Comment 10 Reynaldo H. Verdejo Pinochet 2015-05-31 23:02:48 UTC
commit 1246d93f3e32a13c95c70cf3ba0f26b224de5e58
Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Fri May 1 23:20:30 2015 -0300

    zbar: add frame sample to barcode message
    
    New attach-frame property enables barcode frame
    dumping when set to true.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747557