# Gtk-Demo - images.rb

**URL:** <https://www.ruby-forum.com/t/gtk-demo-images-rb/56964>\
**Category:** Ruby-Gnome 2\
**Created:** [April 6, 2006, 2:33am UTC](https://www.ruby-forum.com/t/gtk-demo-images-rb/56964 "2006-04-06T02:33:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 6, 2006, 2:33am UTC](https://www.ruby-forum.com/t/gtk-demo-images-rb/56964/1 "2006-04-06T02:33:31Z")

</div>

Hey All,

I found the problem with the GTK-Demo program for  
the progressive image loading. It’s really a simple fix:

Line 157 Reads: @image\_stream = File.open(filename,‘r’)  
Line 157  
Should Be: @image\_stream = File.open(filename,‘rb’)

This change  
allows the image to be opened in binary format. Should explictly  
state that, instead of relying on the ‘r’ mode, no matter the  
platform. Once you add the binary flag to the File#open, everything  
works as it should, and it runs just fine.

Also,  
per S. Weinmann’s suggestion, I’ll be creating a couple of libraries  
to Package Glade files into a ZIP file, and allow Loading from it.  
Also, in conjunction with it, I’ll be creating a new GUI Wrapper around  
Glade files for Ruby Apps. Among them, will be the ability to  
package Image files into the ZIP File, and load them directly from the  
ZIP  
file, as well as a cleaner way to package the signal\_connect’s, by  
looking  
into the method\_missing function as a way to get signal\_connect’s  
done, without having to fully define it.

Mario S.

* * *

This [SF.Net](http://SF.Net) email is sponsored by xPML, a groundbreaking scripting  
language  
that extends applications into web and mobile media. Attend the live  
webcast  
and join the prime developer group breaking into this new coding  
territory!  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642)
