[Bese-devel] Serving images through apache

Timothy Jasko tjasko at paragent.com
Wed Sep 13 01:29:39 UTC 2006


Our application uses cl-gd to generate images. Things work fine using  
ucw's server, but not when we go through apache. Does anybody have  
some clues as to what may be going on?

You can see it in action (where "in action" means "not working") at  
http://archon.paragent.com/charts.ucw .


We use this code to generate the images:

(defcomponent png-component ()
   ((width :accessor width
           :initarg :width
           :initform 20)
    (height :accessor height
            :initarg :height
            :initform 20)))

(defmethod render :before ((img png-component))
   (setf (get-header (context.response *context*) "Content-Type")  
"image/png"))

(defgeneric render-png (img)
   (:documentation "Renders the image"))

(defmethod render ((img png-component))
   (let* ((response (ucw:context.response *context*))
          (stream (ucw::network-stream response)))
     (cl-gd:with-image*  ((width img) (height img))
                         (render-png img)
                         (write-image-to-stream stream :png))))



More information about the bese-devel mailing list