Menu

Loading Images

2020-03-26
2020-03-26
  • John Duchek

    John Duchek - 2020-03-26

    I am trying to load an image. I am running this program

    Include "window9.bi"

    Dim As integer hwnd,event
    hwnd=OpenWindow("1",300,10,800,800)
    Var HIMAGE=Load_image("./png_cards/3D.png")
    'ButtonImageGadget(1,10,10,152,232,HIMAGE, BS_PUSHLIKE Or BS_AUTOCHECKBOX)

    Do
    event=WaitEvent()
    If event=EventClose Then End
    Loop
    the image is 152x232.
    It compiles, but
    I am getting many errors and a core dump. If you remember I am running Fedora 31

    Errors:

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.338: gdk_pixbuf_get_has_alpha: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.338: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.338: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_calculate_rowstride: assertion 'width > 0' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GdkPixbuf-CRITICAL **: 21:09:07.339: gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

    (load_image:26140): GLib-ERROR *: 21:09:07.339: ../glib/gmem.c:334: overflow allocating 1844674407370955161518446744073709551615 bytes
    /tmp/geany_run_script_8Q1RH0.sh: line 7: 26140 Trace/breakpoint trap (core dumped) "./load_image"

    I could use a tip on how to deal with these errors.
    Thanks for any help, John

     
  • stabud

    stabud - 2020-03-26

    Hi!

    This error occurs if the 3D.png file is not at the specified address.


    Please note that I recently updated the library. In the update, including I made changes to the Load_image function. Now, if the file is not found, such errors should not be, the function will simply return zero.

     
  • John Duchek

    John Duchek - 2020-03-26

    I am hoping that that update is availble now. I will go get a copy. Thank you.
    John

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.