~inkscape.dev/inkscape/RELEASE_0_37-branch

« back to all changes in this revision

Viewing changes to src/file.cpp

  • Committer: ishmal
  • Date: 2004-02-11 00:19:55 UTC
  • Revision ID: ishmal@users.sourceforge.net-20040211001955-qg6qnxwm878kzt1r
Image import fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
483
483
            (strcmp (e, "xpm") == 0)) {
484
484
                /* Try pixbuf */
485
485
                GdkPixbuf *pb;
486
 
                pb = gdk_pixbuf_new_from_file (filename, NULL);
 
486
        GError *err = NULL;
 
487
                pb = gdk_pixbuf_new_from_file (filename, &err);
487
488
                if (pb) {
488
489
                        /* We are readable */
489
490
                        repr = sp_repr_new ("image");
495
496
                        sp_repr_unref (repr);
496
497
                        sp_document_done (doc);
497
498
                        gdk_pixbuf_unref (pb);
498
 
                }
 
499
                } else {
 
500
            //error stuff here
 
501
            if (err) {
 
502
                gchar *text;
 
503
                        text = g_strdup_printf(
 
504
                      _("Unable to import image '%s': %s"),
 
505
                      filename, err->message);
 
506
                sp_ui_error_dialog (text);
 
507
                g_free (text);
 
508
                g_error_free (err);
 
509
            }
 
510
        }
499
511
        }
500
512
}
501
513