images.http: allow urls to be used with http-image.
parent
0b6dae0a93
commit
f4cc2bcdaa
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs http.client images.loader
|
USING: accessors assocs http.client images.loader
|
||||||
images.loader.private images.viewer io.pathnames kernel
|
images.loader.private images.viewer io.pathnames kernel
|
||||||
namespaces sequences ;
|
namespaces present sequences ;
|
||||||
IN: images.http
|
IN: images.http
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
@ -14,7 +14,8 @@ IN: images.http
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: load-http-image ( path -- image )
|
: load-http-image ( path -- image )
|
||||||
[ http-get swap content-type ] [ file-extension ] bi or
|
[ http-get swap content-type ]
|
||||||
|
[ present file-extension ] bi or
|
||||||
(image-class) load-image* ;
|
(image-class) load-image* ;
|
||||||
|
|
||||||
: http-image. ( path -- )
|
: http-image. ( path -- )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue