diff --git a/basis/images/cocoa/cocoa.factor b/basis/images/cocoa/cocoa.factor index 115315aa18..6d4b97da1f 100644 --- a/basis/images/cocoa/cocoa.factor +++ b/basis/images/cocoa/cocoa.factor @@ -1,7 +1,7 @@ ! (c)2010 Joe Groff bsd license USING: accessors alien.data cocoa cocoa.classes cocoa.messages combinators core-foundation.data core-graphics.types fry images -images.loader io kernel literals math sequences ; +images.loader io kernel math sequences ; IN: images.cocoa SINGLETON: ns-image @@ -36,9 +36,9 @@ ERROR: ns-image-planar-images-not-supported ; : check-return ( n -- ) { - { $ NSImageRepLoadStatusUnknownType [ ns-image-unknown-type ] } - { $ NSImageRepLoadStatusInvalidData [ ns-image-invalid-data ] } - { $ NSImageRepLoadStatusUnexpectedEOF [ ns-image-unexpected-eof ] } + { NSImageRepLoadStatusUnknownType [ ns-image-unknown-type ] } + { NSImageRepLoadStatusInvalidData [ ns-image-invalid-data ] } + { NSImageRepLoadStatusUnexpectedEOF [ ns-image-unexpected-eof ] } [ drop ] } case ; diff --git a/basis/images/gdiplus/gdiplus.factor b/basis/images/gdiplus/gdiplus.factor index 7b47af3d3a..d97bd5c467 100644 --- a/basis/images/gdiplus/gdiplus.factor +++ b/basis/images/gdiplus/gdiplus.factor @@ -1,9 +1,8 @@ ! (c)2010 Joe Groff bsd license USING: accessors alien.c-types alien.data alien.enums -classes.struct destructors images images.loader -io.streams.limited kernel locals math windows.com -windows.gdiplus windows.streams windows.types typed -byte-arrays grouping sequences ; +classes.struct destructors images images.loader kernel locals +math windows.com windows.gdiplus windows.streams windows.types +typed byte-arrays grouping sequences ; IN: images.gdiplus SINGLETON: gdi+-image diff --git a/basis/images/loader/loader.factor b/basis/images/loader/loader.factor index 52a80459d9..7be8300f63 100644 --- a/basis/images/loader/loader.factor +++ b/basis/images/loader/loader.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2009 Doug Coleman, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. -USING: assocs byte-arrays io.encodings.binary io.files -io.pathnames io.streams.byte-array io.streams.limited -io.streams.throwing kernel namespaces sequences strings -unicode.case fry ; +USING: ascii assocs byte-arrays io.encodings.binary io.files +io.pathnames io.streams.byte-array kernel namespaces sequences +strings fry ; IN: images.loader ERROR: unknown-image-extension extension ; @@ -19,9 +18,6 @@ types [ H{ } clone ] initialize : image-class ( path -- class ) file-extension (image-class) ; -: open-image-file ( path -- stream ) - binary ; - PRIVATE> ! Image Decode @@ -34,16 +30,18 @@ GENERIC: stream>image ( stream class -- image ) swap types get set-at ; : load-image ( path -- image ) - [ open-image-file ] [ image-class ] bi load-image* ; + [ binary ] [ image-class ] bi load-image* ; M: object load-image* stream>image ; M: byte-array load-image* [ binary ] dip stream>image ; -M: string load-image* [ open-image-file ] dip stream>image ; +M: string load-image* + [ binary ] dip stream>image ; -M: pathname load-image* [ open-image-file ] dip stream>image ; +M: pathname load-image* + [ binary ] dip stream>image ; ! Image Encode @@ -52,4 +50,3 @@ GENERIC: image>stream ( image class -- ) : save-graphic-image ( image path -- ) [ image-class ] [ ] bi binary [ image>stream ] with-file-writer ; -