Fork me on GitHub

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, 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.

Eric Ervin23:04:21

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]))


(defn setup []
  {:img (q/load-image "prog9.png")})

(defn update-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]))