Hi Dave,

I pushed some code which will do what you want.

In this example, we download Factor's logo (which is a PNG) load it using
Cocoa, and then save it to a local file into JPEG, PNG, and GIF formats.

    USING: core-foundation.launch-services images.http
    images.loader.cocoa ;

    "http://factorcode.org/logo.png"; load-http-image
    [ "/tmp/logo.jpg" kUTTypeJPEG save-ns-image ]
    [ "/tmp/logo.png" kUTTypePNG save-ns-image ]
    [ "/tmp/logo.gif" kUTTypeGIF save-ns-image ] tri

How's that work for you?

Best,
John.

P.S. You'll need to update to the latest development version, which if you
haven't done it is as simple as "./build-support/factor.sh update" from the
factor checkout.

P.P.S. I might change the names of ``save-ns-image`` and maybe make a
cleaner API instead of having to use those constants directly...



On Fri, Sep 20, 2013 at 9:03 AM, Dave Spanton <davespan...@gmail.com> wrote:

> Thanks John. Unfortunately uses image>stream, which doesn't seem to have a
> method for the ns-image class, which all images seem to be on OS X.
>
> I wonder if there's any cocoa stuff that could do it.
>
>
> Cheers,
> Dave.
>
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8,
> SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack
> includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to