remote image sounds librariable to me. :)  I'm all in favor of keeping
the C code size down by adding optional ruby libraries to do certain
funner things. Then potentially on compiling an app to shy or
executable only the needed libraries would be included, keeping code
size down even further.

I'm seconding Don's findings on jpg on Windows. png and gif seem to
load fine but jpg crashes the system somehow. I peeked at the
applicable source but it's a bit deep for me from out here.

Also, I've found that the Video object never seems to function
properly in shoes. I had a similar problem with H-H, it just displays
a blank area. I've tried flv, mpg, divx, xvid both locally and from
web addresses.

(If there's a bugtraq, you know, just point me there thx ;)

- - Jesse

On Jan 26, 2008 7:41 PM, Don Park <[EMAIL PROTECTED]> wrote:
> Thanks for the method. In playing with it, I've noticed on the windows
> platform, r396, that using the 'image' method with a png works fine
> but with a jpg image, the shoes app crashes.
>
> Don
>
> On Jan 11, 2008 2:10 PM, why the lucky stiff <[EMAIL PROTECTED]> wrote:
> >
> > On Fri, Jan 11, 2008 at 01:43:46PM -0800, Don Park wrote:
> > > is there an easy way to load a remote image for use with the 'image' 
> > > method?
> > >
> > > image "http://www.google.com/intl/en_ALL/images/logo.gif";
> > > that looks on the local filesystem
> >
> > Sure, yeah.
> >
> >   class Shoes
> >     def remote_image uri, opts = {}, &blk
> >       uri = URI(uri) unless uri.is_a? URI
> >       uri.open do |fin|
> >         name = uri.host + "." + fin.meta['etag'].gsub(/[^\w\-\.]/, '') +
> >           File.extname(uri.path)
> >         cache_path = File.join(LIB_DIR, name)
> >         unless File.exists? cache_path
> >           File.open(cache_path, 'w') do |fout|
> >             while chunk = fin.read(16384)
> >               fout.write chunk
> >             end
> >           end
> >         end
> >         image cache_path, opts, &blk
> >       end
> >     end
> >   end
> >
> > This will be in Shoes soon.  I just need to make some caching decisions.
> >
> > _why
> >
>

Reply via email to