Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Web+pages+with+images?V=7
QUERY_STRINGV=7
CONTENT_TYPE
DOCUMENT_URI/revision/Web+pages+with+images
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.127.146
REMOTE_PORT54080
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.128.199.162
HTTP_CF_RAY87ff68dd7b5b2913-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.128.199.162
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Web pages with images} {[Theo Verelst]

Today I was making pictures available on a [tclhttpd] server, and wanted to make a few hundred automatically sized, compressed (progressive), listed per 10 on a web page as little images with can be clicked on to expand.

The result: http://82.171.148.176/Pictures3/list1.html

I used the cygnus supplied, though separately downloadable, check some search engine, 
cjpeg/djpeg routines, and used a tcl script to use them on lists of image files:

======
set j DSC00155b1m ; 
eval "exec /bin/djpeg -scale 1/1 $j.jpg |   /bin/cjpeg.exe  -quality 18 -progressive -outfile $j\_c.jpg"
======

The djpeg decompresses the source jpeg file, pipe-s it through to cjpeg, 
which reencodes it with quality 18, which is pretty compressed to another file. 
These tools are quite high quality, and make compact encoded images look relatively good.

The final commands where like this, to make a small and full scale 
both quite compressed image set per input image:

======
set inp $path_to_source_images
set outp $path_to_destination_images

foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/4 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 15 -progressive -outfile $outp/$j\_cs.jpg"}

foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/1 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 25 -progressive -outfile $outp/$j\_cn.jpg"}
======

Automatically, all .jpg images in the source dir will be encoded in 1/4 size and full size 
in the dest directory, both with progressive encoding, allowing a browser to start displaying 
a course impression of the image as soon as a little of the data has been downloaded.

Now we have the target images (you may want to make quality for normal sized images a bit higher, 
but of course this makes them slower on modem lines), we want to list them on static web pages. 
It would be possible to do dynamic pages or a Direct_Url, but in this case I wanted fixed pages. 
These are generated automatically from the image names, and a template page, which looks like this 
in a text window .tt.t (as is opened by open_text in [bwise]), which one can easily create of course by:

======
toplevel .t
pack [text .t.tt]
======

My template:

======html
<html>
<h2>Theo Verelst Local Picture Pages</h2>
<i>
All recent pictures I made are on these linked pages, see the serial  number.<br>
Click on the small images to see a larger, but quickly loading version.
</i>
<P>
Page  
[expr $page]
 of 
[expr $pmx]
 <a href="/Pictures3/list.html">Picture Page list</a> 
 <a href="/Pictures3/list1.html">First</a> 
<a href="/Pictures3/list
[expr 1+($page-1-1)%($pmx)]
.html">Previous</a> 
<a href="/Pictures3/list
[expr 1+($page-1+1)%($pmx)]
.html">Next</a> 
<a href="/Pictures3/list
[expr $pmx]
.html">Last</a> 
<P>
[append pims]
<P>
<a href="http://www.theover.org">Local Home</a> 
<a href="http://theover.tripod.com">Tripod</a> 
<a href="http://home.tiscali.nl/theoverelst">Bookmark here</a> 
<a href="/Pictures3/list
[expr 1+($page-1+1)%($pmx)]
.html">Next</a> 

</html>
======

Now we need to use our page generator script to make int(#images/10)+1 pages 
using this template and the procedure:

======
proc locpicgen {} {
   set outp "/Docroot/Pictures3/"
   set pmx [expr 0+((5 + [llength [glob $outp/*_cs.jpg]]) / 10)]
   for {set page 1} {$page <= $pmx} {incr page} {
      set pnr [expr 1+(($page-1) * 10)]
      set imlist [lrange [lsort [glob $outp/*_cs.jpg]] [expr $pnr-1] [expr $pnr-1+9]]
      set pims {}; foreach i $imlist {set j [file root [file tail $i]]; append pims "<a href=\"[string range $j 0 end-2]cn.jpg\"><img src=\"$j.jpg\"></a> <b>[string range $j 0 end-3 ]</b> <P>\n"}
      set pagst 0; set pag {}; foreach i [split [.tt.t get 0.0 end] \n] {if {[string index $i 0] == "\["} {; eval append pag $i; set pagst 1;} {if {$pagst == "1"} {set pagst 0} {append pag \n}; append pag $i}}
      set f [open $outp/list$page.html w] ; puts $f $pag ;close $f
   }
   set f [open $outp/list.html w] ; 
   puts $f "<html><h2>Theo Verelst Local Picture Page List</h2>"
   puts $f "Local Picture page numbers, follows links to pages with 10 pictures each<P>"
   for {set page 1} {$page <= $pmx} {incr page} {
      puts $f "<a href=\"list$page.html\"> $page </a><br>"
   }
   puts $f {<P><a href="http://82.168.209.239">Local Home</a> <a href="http://theover.tripod.com">Tripod</a> <a href="http://home.tiscali.nl/theover">Bookmark here</a> <P>}
   puts $f "</html>"
   close $f
} 
======

Call the procedure once:

======
locpicgen
======

and presto, lots of pages with neatly listed images.


[HJG] 2006-01-18 the website above looks offline.

<<categories>> Image Processing} regexp2} CALL {my render {Web pages with images} {[Theo Verelst]

Today I was making pictures available on a [tclhttpd] server, and wanted to make a few hundred automatically sized, compressed (progressive), listed per 10 on a web page as little images with can be clicked on to expand.

The result: http://82.171.148.176/Pictures3/list1.html

I used the cygnus supplied, though separately downloadable, check some search engine, 
cjpeg/djpeg routines, and used a tcl script to use them on lists of image files:

======
set j DSC00155b1m ; 
eval "exec /bin/djpeg -scale 1/1 $j.jpg |   /bin/cjpeg.exe  -quality 18 -progressive -outfile $j\_c.jpg"
======

The djpeg decompresses the source jpeg file, pipe-s it through to cjpeg, 
which reencodes it with quality 18, which is pretty compressed to another file. 
These tools are quite high quality, and make compact encoded images look relatively good.

The final commands where like this, to make a small and full scale 
both quite compressed image set per input image:

======
set inp $path_to_source_images
set outp $path_to_destination_images

foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/4 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 15 -progressive -outfile $outp/$j\_cs.jpg"}

foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/1 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 25 -progressive -outfile $outp/$j\_cn.jpg"}
======

Automatically, all .jpg images in the source dir will be encoded in 1/4 size and full size 
in the dest directory, both with progressive encoding, allowing a browser to start displaying 
a course impression of the image as soon as a little of the data has been downloaded.

Now we have the target images (you may want to make quality for normal sized images a bit higher, 
but of course this makes them slower on modem lines), we want to list them on static web pages. 
It would be possible to do dynamic pages or a Direct_Url, but in this case I wanted fixed pages. 
These are generated automatically from the image names, and a template page, which looks like this 
in a text window .tt.t (as is opened by open_text in [bwise]), which one can easily create of course by:

======
toplevel .t
pack [text .t.tt]
======

My template:

======html
<html>
<h2>Theo Verelst Local Picture Pages</h2>
<i>
All recent pictures I made are on these linked pages, see the serial  number.<br>
Click on the small images to see a larger, but quickly loading version.
</i>
<P>
Page  
[expr $page]
 of 
[expr $pmx]
 <a href="/Pictures3/list.html">Picture Page list</a> 
 <a href="/Pictures3/list1.html">First</a> 
<a href="/Pictures3/list
[expr 1+($page-1-1)%($pmx)]
.html">Previous</a> 
<a href="/Pictures3/list
[expr 1+($page-1+1)%($pmx)]
.html">Next</a> 
<a href="/Pictures3/list
[expr $pmx]
.html">Last</a> 
<P>
[append pims]
<P>
<a href="http://www.theover.org">Local Home</a> 
<a href="http://theover.tripod.com">Tripod</a> 
<a href="http://home.tiscali.nl/theoverelst">Bookmark here</a> 
<a href="/Pictures3/list
[expr 1+($page-1+1)%($pmx)]
.html">Next</a> 

</html>
======

Now we need to use our page generator script to make int(#images/10)+1 pages 
using this template and the procedure:

======
proc locpicgen {} {
   set outp "/Docroot/Pictures3/"
   set pmx [expr 0+((5 + [llength [glob $outp/*_cs.jpg]]) / 10)]
   for {set page 1} {$page <= $pmx} {incr page} {
      set pnr [expr 1+(($page-1) * 10)]
      set imlist [lrange [lsort [glob $outp/*_cs.jpg]] [expr $pnr-1] [expr $pnr-1+9]]
      set pims {}; foreach i $imlist {set j [file root [file tail $i]]; append pims "<a href=\"[string range $j 0 end-2]cn.jpg\"><img src=\"$j.jpg\"></a> <b>[string range $j 0 end-3 ]</b> <P>\n"}
      set pagst 0; set pag {}; foreach i [split [.tt.t get 0.0 end] \n] {if {[string index $i 0] == "\["} {; eval append pag $i; set pagst 1;} {if {$pagst == "1"} {set pagst 0} {append pag \n}; append pag $i}}
      set f [open $outp/list$page.html w] ; puts $f $pag ;close $f
   }
   set f [open $outp/list.html w] ; 
   puts $f "<html><h2>Theo Verelst Local Picture Page List</h2>"
   puts $f "Local Picture page numbers, follows links to pages with 10 pictures each<P>"
   for {set page 1} {$page <= $pmx} {incr page} {
      puts $f "<a href=\"list$page.html\"> $page </a><br>"
   }
   puts $f {<P><a href="http://82.168.209.239">Local Home</a> <a href="http://theover.tripod.com">Tripod</a> <a href="http://home.tiscali.nl/theover">Bookmark here</a> <P>}
   puts $f "</html>"
   close $f
} 
======

Call the procedure once:

======
locpicgen
======

and presto, lots of pages with neatly listed images.


[HJG] 2006-01-18 the website above looks offline.

<<categories>> Image Processing}} CALL {my revision {Web pages with images}} CALL {::oo::Obj7301764 process revision/Web+pages+with+images} CALL {::oo::Obj7301762 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4