On Mon, Aug 20, 2012 at 10:26:41PM +0200, Peter Bex wrote:
> On Mon, Aug 20, 2012 at 10:11:04PM +0200, Markus Klotzbuecher wrote:
> > Hi All,
> >
> > I would like to try the phoghorn image gallery generator, but I just
> > can't get the egg compiled. It fails because it can't find the epeg
> > library and "epeg-config". I can't find it either, not as a debian
> > package nor as sources on the net.
> >
> > Is the epeg code still developed?
>
> No, epeg is dead, even more dead than imlib2. I think the current
> replacement library from the E project for both these libraries
> is the "evas" library. I had plans to convert phoghorn to evas
> someday (and make an evas egg), but I don't currently use phoghorn
> anymore.
>
> > From looking at the phoghorn code it seems that imlib2 is also
> > supported. Could it be used with the latter only?
>
> I think you could easily hack out the epeg bits; imlib2 supports
> jpeg as well, I think.
That indeed turned out to be easy (patch attached).
But I can't get it to work with spiffy. I added the following to
launch and configure spiffy:
;; runspiffy.scm
(use spiffy ssp-handler)
(file-extension-handlers `(("ssp" . ,ssp-handler)))
(index-files '("index.ssp"))
(server-port 8080)
(root-path "/home/mk/web/wwwroot")
and in wwwroot there is
galleries/
galleries/index.ssp ;; copied from the phoghorn egg page
galleries/zoomed.ssp ;;
galleries/gallery1/ ;; folders with images
...
Now when browse to localhost:8080/galleries/ I see the contexts of
index.ssp (apparently as a result of executing index.sspx)
No need to mention I'm a web-development noob...
Thanks for any hints!
Markus
>From b4a0d5d8b37a5e0164c33346688c7a54fc53b913 Mon Sep 17 00:00:00 2001
From: Markus Klotzbuecher <[email protected]>
Date: Tue, 21 Aug 2012 08:48:56 +0200
Subject: [PATCH] remove epeg dependency from phoghorn
---
release/4/phoghorn/trunk/phoghorn.meta | 2 +-
release/4/phoghorn/trunk/phoghorn.scm | 31 ++++++-------------------------
2 files changed, 7 insertions(+), 26 deletions(-)
diff --git a/release/4/phoghorn/trunk/phoghorn.meta b/release/4/phoghorn/trunk/phoghorn.meta
index a3432d4..aaba3ea 100644
--- a/release/4/phoghorn/trunk/phoghorn.meta
+++ b/release/4/phoghorn/trunk/phoghorn.meta
@@ -7,5 +7,5 @@
(category web)
(license "BSD")
(doc-from-wiki)
- (needs spiffy uri-common epeg imlib2 sxml-transforms)
+ (needs spiffy uri-common imlib2 sxml-transforms sxml-fu)
(files "phoghorn.scm" "phoghorn.meta" "phoghorn.release-info" "phoghorn.setup"))
diff --git a/release/4/phoghorn/trunk/phoghorn.scm b/release/4/phoghorn/trunk/phoghorn.scm
index 957dfb7..c0fae2f 100644
--- a/release/4/phoghorn/trunk/phoghorn.scm
+++ b/release/4/phoghorn/trunk/phoghorn.scm
@@ -33,14 +33,12 @@
(gallery-dir gallery-var entry-var root-gallery-name
max-thumb-dimensions thumb-dir gallery-url zoomed-url movie-image
current-gallery current-entry-filename gallery-contents
- thumbnail thumbnail/epeg thumbnail/imlib2
- galleries-up-to prev-entry next-entry phoghorn-rules)
+ thumbnail thumbnail/imlib2 galleries-up-to prev-entry
+ next-entry phoghorn-rules)
(import chicken scheme extras data-structures files posix)
(require-extension srfi-1 srfi-13 spiffy intarweb uri-common sxml-transforms)
-(require-library epeg)
-(import (prefix epeg epeg:))
(require-library imlib2)
(import (prefix imlib2 imlib2:))
@@ -56,13 +54,11 @@
;; #f if you want the filename displayed
(define movie-image (make-parameter "/pics/movie.jpg"))
-(define epeg-extensions '("jpeg" "jpg"))
-
;; This really is dependent on the loaders imlib2 has. Mebbe make it
;; a parameter as well?
-(define imlib-extensions '("gif" "bmp" "xpm" "png" "mng" "pbm" "tif" "tiff"
- "tga" "pic" "pcx" "dxf" "cgm" "cdr" "wmf" "eps"
- "emf" "pict" "yuv"))
+(define imlib-extensions '("jpeg" "jpg" "gif" "bmp" "xpm" "png" "mng" "pbm"
+ "tif" "tiff" "tga" "pic" "pcx" "dxf" "cgm" "cdr"
+ "wmf" "eps" "emf" "pict" "yuv"))
(define movie-extensions '("mpg" "mpeg" "avi" "ogg" "ogm" "vob" "asf" "wma"
"wmv" "qt" "mov" "mp4" "vivo" "fli" "flc" "ani"
@@ -71,7 +67,7 @@
;; XXX: use extensions or file magic/mimetypes?
(define (allowed-filetype? filename)
(any (cut string-ci=? (or (pathname-extension filename) "") <>)
- (append epeg-extensions imlib-extensions movie-extensions)))
+ (append imlib-extensions movie-extensions)))
;; Either the thumbs subdirectory is ok, or it can be created
(define (thumbs-ok? dir)
@@ -112,8 +108,6 @@
(let* ((ext (pathname-extension entry))
(match? (lambda (s) (string-ci=? ext s))))
(cond
- ((any match? epeg-extensions)
- (thumbnail/epeg gallery entry))
((any match? imlib-extensions)
(thumbnail/imlib2 gallery entry))
((any match? movie-extensions)
@@ -163,19 +157,6 @@
(define (gallery-thumbs gallery)
(make-pathname gallery (thumb-dir)))
-(define (thumbnail/epeg gallery entry)
- (let ((target-file (local-file (gallery-thumbs gallery) entry)))
- (unless (file-exists? target-file)
- (let ((img (epeg:image-open (local-file gallery entry))))
- (receive (width height)
- (epeg:image-size img)
- (epeg:image-size-set! img
- (thumb-width width height)
- (thumb-height width height))
- (epeg:image-file-output-set! img target-file)
- (epeg:image-encode img)))))
- (remote-file (gallery-thumbs gallery) entry))
-
;; Imlib doesn't have loaders to save every type it can read, so we have
;; to pick some kind of standardised output format. Png is probably the
;; most suitable one because it is portable and supports alpha channels.
--
1.7.10.4
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users