Re: Add option to select tag icon from file (Bug 461447)
- From: "Miguel Agüero" <miguelaguero gmail com>
- To: declan frogface org
- Cc: f-spot-list gnome org
- Subject: Re: Add option to select tag icon from file (Bug 461447)
- Date: Sat, 22 Sep 2007 14:19:04 -0400
Hi,
I am looking the same bug, but i was thinking that is better that
initially you you cannot change the icon. I propose (and i am working
in) when is a parent tag, select one default icon, but if is a child
tag, take the icon from their parent. I think in a future could be
better remove the New icon dialog and try to set this directly in the
tag list. when you make click in menu New tag, put the tag inside the
tag list with some text like New Tag (if is parent) or new <Parent>
tag (in childs, like New Event Tag or New Favorite Tag). If the user
would like to change, he'll ned to change the title and icon (that
could be from a picker).
Frogface, let me know how we can work together.
Thanks,
Miguel Aguero
On 9/22/07, Frogface <declan frogface org> wrote:
> Hi,
>
> I'm just looking at this bug and am trying to work out what to do with the the image filepath once I have gotten it from the user. FYI, I'm new to Pixbuf and friends...
>
> Here is my dodgy work in progress code (warts and all)
>
> ----------------------------------------------------------------------------------------
> private void HandleExternalFileSelectionChanged (object sender, EventArgs args)
> {
> // FIXME: Declan asks, Is the following needed?
> //if (args.ResponseId != Gtk.ResponseType.Ok) {
> // FIXME this is to work around a bug in gtk+ where
> // the filesystem events are still listened to when
> // a FileChooserButton is destroyed but not finalized
> // and an event comes in that wants to update the child widgets.
> // Dialog.Destroy ();
> // external_photo_chooser.Dispose ();
> // external_photo_chooser = null;
> // return;
> //}
>
> if (external_photo_chooser.Uri != null) {
> Gnome.Vfs.Uri dest = new Gnome.Vfs.Uri (external_photo_chooser.Uri);
> Console.WriteLine (external_photo_chooser.Uri);
>
> //START OF COPY AND PASTED CODE FROM HandleSelectionChanged
> int x, y, width, height;
> Gdk.Pixbuf tmp = null;
>
> image_view.GetSelection (out x, out y, out width, out height);
>
> if (image_view.Pixbuf != null) {
> if (width > 0 && height > 0) {
> //tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height);
> tmp = new Gdk.Pixbuf(external_photo_chooser.Uri, x, y, width, height);
>
> PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (tmp);
>
> tmp.Dispose ();
> } else {
> PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (image_view.Pixbuf);
> }
> }
> //END OF COPY AND PASTED CODE
>
> }
> Console.WriteLine ("Happy talk like a pirate day!");
> }
> ----------------------------------------------------------------------------------------
>
> I select a photo and ok the Edit Icon dialog and nothing much happens. Then I ok the Edit Tag dialog (which opened the Edit Icon dialog) and get the error
>
> ---------------------------------------------------------------------------------------
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixdata_from_pixbuf: assertion `GDK_IS_PIXBUF (pixbuf)' failed
>
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixdata_serialize: assertion `pixdata->magic == GDK_PIXBUF_MAGIC_NUMBER' failed
> error System.ArgumentNullException: Argument cannot be null.
> at <0x00000> <unknown method>
> at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_from_unmanaged (intptr,int,System.Array,int)
> at System.Runtime.InteropServices.Marshal.Copy (IntPtr source, System.Byte[] destination, Int32 startIndex, Int32 length) [0x00000]
> at PixbufSerializer.Serialize (Gdk.Pixbuf pixbuf) [0x00000]
> at TagStore.GetIconString (.Tag tag) [0x00000]
> at TagStore.Commit (.DbItem item, Boolean update_xmp) [0x00000]
> at TagCommands+Edit.Execute (.Tag t) [0x00000]
>
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_width: assertion `pixbuf != NULL' failed
> (f-spot:20102): GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `pixbuf != NULL' failed
>
> -------------------------------------------------------------------------------------
>
> Why isn't an icon being generated from the file the user entered? Also, any tips on getting the preview image to change in the Edit Icon dialog?
>
> All the best,
> Declan
> _______________________________________________
> F-spot-list mailing list
> F-spot-list gnome org
> http://mail.gnome.org/mailman/listinfo/f-spot-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]