From 7a5142e0ca59e5beb96b9d9d3cb9717e584d5bd0 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 4 Apr 2016 12:55:18 -0700 Subject: [PATCH] images.http: make it easier to image. stuff. --- extra/images/http/http.factor | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/extra/images/http/http.factor b/extra/images/http/http.factor index a4c064619c..8ada757175 100644 --- a/extra/images/http/http.factor +++ b/extra/images/http/http.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors assocs http.client images.loader -images.loader.private images.viewer io.pathnames kernel -namespaces present sequences ; +USING: accessors assocs combinators.short-circuit http.client +images.loader images.loader.private images.viewer io.pathnames +kernel namespaces present sequences strings urls ; IN: images.http [ present file-extension ] bi or (image-class) load-image* ; +M: string set-image + dup { [ "http://" head? ] [ "https://" head? ] } 1|| + [ load-http-image ] [ load-image ] if >>image ; + +M: url set-image + protocol>> load-http-image >>image ; + : http-image. ( path -- ) load-http-image image. ;