images.cocoa: work around broken limited-stream behavior
parent
e433b16b42
commit
3029a94756
|
@ -1,18 +1,18 @@
|
||||||
! (c)2010 Joe Groff bsd license
|
! (c)2010 Joe Groff bsd license
|
||||||
USING: accessors alien.data cocoa cocoa.classes cocoa.messages
|
USING: accessors alien.data cocoa cocoa.classes cocoa.messages
|
||||||
combinators core-foundation.data core-graphics.types fry images
|
combinators core-foundation.data core-graphics.types fry images
|
||||||
images.loader io kernel literals ;
|
images.loader io io.streams.limited kernel literals ;
|
||||||
IN: images.cocoa
|
IN: images.cocoa
|
||||||
|
|
||||||
SINGLETON: ns-image
|
SINGLETON: ns-image
|
||||||
! "png" ns-image register-image-class
|
"png" ns-image register-image-class
|
||||||
! "tif" ns-image register-image-class
|
"tif" ns-image register-image-class
|
||||||
! "tiff" ns-image register-image-class
|
"tiff" ns-image register-image-class
|
||||||
! "gif" ns-image register-image-class
|
"gif" ns-image register-image-class
|
||||||
! "jpg" ns-image register-image-class
|
"jpg" ns-image register-image-class
|
||||||
! "jpeg" ns-image register-image-class
|
"jpeg" ns-image register-image-class
|
||||||
! "bmp" ns-image register-image-class
|
"bmp" ns-image register-image-class
|
||||||
! "ico" ns-image register-image-class
|
"ico" ns-image register-image-class
|
||||||
|
|
||||||
CONSTANT: NSImageRepLoadStatusUnknownType -1
|
CONSTANT: NSImageRepLoadStatusUnknownType -1
|
||||||
CONSTANT: NSImageRepLoadStatusReadingHeader -2
|
CONSTANT: NSImageRepLoadStatusReadingHeader -2
|
||||||
|
@ -61,4 +61,6 @@ PRIVATE>
|
||||||
f >>upside-down? ;
|
f >>upside-down? ;
|
||||||
|
|
||||||
M: ns-image stream>image
|
M: ns-image stream>image
|
||||||
drop [ load-image-rep ] with-input-stream image-rep>image ;
|
drop
|
||||||
|
dup limited-stream? [ stream-eofs >>mode ] when
|
||||||
|
[ load-image-rep ] with-input-stream image-rep>image ;
|
||||||
|
|
Loading…
Reference in New Issue