This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-23
Channels
- # announcements (2)
- # beginners (82)
- # calva (13)
- # cider (12)
- # clara (4)
- # cljdoc (22)
- # clojure (89)
- # clojure-dev (23)
- # clojure-europe (16)
- # clojure-italy (39)
- # clojure-nl (8)
- # clojure-spec (28)
- # clojure-uk (36)
- # clojurescript (40)
- # cursive (10)
- # data-science (1)
- # datomic (27)
- # devcards (4)
- # emacs (1)
- # fulcro (25)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (5)
- # luminus (1)
- # nrepl (68)
- # off-topic (64)
- # pedestal (23)
- # planck (1)
- # quil (4)
- # re-frame (6)
- # reitit (5)
- # remote-jobs (4)
- # shadow-cljs (16)
- # spacemacs (11)
- # testing (1)
For @pez, demonstrating the "tainted by cross-origin data" problem with loading an image.
I’ll have a look, @lspector. But I’m far from an expert on these things so don’t expect much. 😃
Thanks @pez. The issue is that we just can't load any image at all. We definitely used to be able to. I just downloaded a fresh version of https://github.com/PEZ/quil-cljs-calva-template, added (q/load-image "prog9.png")
to setup
, added the image to resources/public, ran lein cljsbuild once
, opened index.html, and I get the same error. So it's not anything else about the student's project from which I produced the file attached above.
hmmmm... I see the image here. Once I made it into a functioning quil project in core.cljs, (also shrinking that ginormous image to 211k), "lein compile", and opened index.html, it looks fine. Let me see if I can post my core.cljs ....
(ns drawing-project.core
(:require [quil.core :as q :include-macros true]
[quil.middleware :as m]))
;;(enable-console-print!)
(defn setup []
{:img (q/load-image "prog9.png")})
(defn update-state [state]
state)
(defn draw-state [state]
(q/background 200)
(q/image (:img state) 0 0))
(defn run-sketch []
(q/defsketch drawing-project
:host "drawing-project"
:size [500 500]
:setup setup
:update update-state
:draw draw-state
:middleware [m/fun-mode]))