so about image processing. sure I know that tgere is gxml but I dont have any samples or documentation how to edit some image and show it to user in web browser
there is some stuff I done by my self. this is maximum I can figure out in attachments you can see what I have done and there it is on web http://katalogs.core.lv/demo
peace of script. this section will build thumbnails from images in selected folder (on the web page you can see)
buff = Stdio.read_bytes("/box1/demo/"+id->variables->cat+"/"+id->variables->img); if (buff != 0 ) {
object OurImage; OurImage = Image.JPEG.decode(buff); float xsize = (float) OurImage->xsize(); float ysize = (float) OurImage->ysize();
float scale = 1.0; if (xsize > ysize) scale = ((float) 90)/xsize; else scale = ((float) 70)/ysize;
OurImage = OurImage->scale(scale); reply = Image.JPEG.encode(OurImage); array dir = get_dir("/box1/boss/demothumbs/"+id->variables->cat+"/"); if (arrayp(dir)==0) { mkdir("/box1/boss/demothumbs/"+id->variables->cat+"/"); } open_res = me->open("/box1/boss/demothumbs/"+id->variables->cat+"/" + id->variables->img,"cw"); if (open_res == 1) me->write(reply); me->close(); } else { open_res = me->open("/box2/fotodata/default/not_found.gif","r"); reply = me->read(); me->close(); }
so there I made decode and encode jpg image and image resizing
so I wan to add there more image pike options like sharpen blur colorize lighten darken and more (or also draw some ither image transparent gif as logo ) of course these options will be seperated by if conditions
it would give ability to proccess images on the fly and add some effects
on the web site you can see some samples I have done with cimg and gtext but I dont like this pike is faster and more options more
actualy I wan to create a web site where users can pick some image put some nice text on it some masks effects borders . in one word . add on image some stilistic stuff and in result will get very nice personalised postcard
.. also it is important for web site creation dinamicaly draw texts effects and more on images
OurImage = Image.JPEG.decode(buff);
If you're creating thumbnails, I would recommend to use | Image.JPEG.decode(buff,(["scale_num":1,"scale_denum":8])) since JPEGlib then is given freedom to scale the image to 1/8th immediately, and this usually speeds things up a lot. (2 and 4 works too.)
När jag försöker läsa det kommenterade inlägget så får jag:
Signaling: (args-out-of-range #<buffer "kom.lysator.liu.se"> 662909 664760) make-extent(662909 664760) lyskom-limited-make-overlay(662909 664760) lyskom-format-insert-overlays(662909 (FORMAT-STATE . ["%#2$%#1t\n" 9 (... ...) 2 "<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>\n" nil (...) nil 0])) lyskom-format-insert("%#2$%#1t\n" ((TEXT-STAT . [9104889 ... 7871 67 1899 0 ... ...]) . "<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>") (face kom-text-body-face)) lyskom-print-text((TEXT-STAT . [9104889 (TIME . ...) 7871 67 1899 0 (... ...) (... ... ... ... ... ... ... ... ... ...)]) (TEXT . [9104889 "Bilaga (index.htm) till: Fw: can anybody help me\n<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>"]) t 9104889 nil) lyskom-view-text(9104889 t t (CONF-STAT . [10353 "Pike (-) developers forum" (CONF-TYPE nil nil nil nil nil nil nil nil) (TIME . ...) (TIME . ...) 725 7430238 725 0 725 0 9999999 57 1 2620 0 nil]) 120 nil t nil) byte-code("..." [type read-list action text-no read-info lyskom-reading-list lyskom-tell-internat kom-tell-read next-text 0 lyskom-insert-string completely-read-conf not-in-any-conf nil 3 2 REVIEW-TREE (REVIEW REVIEW-MARK REVIEW-FAQ) delq cache-del-text-stat lyskom-view-text 1 (REVIEW REVIEW-MARK) lyskom-is-read read-list-delete-text is-review tri is-review-tree mark-as-read priority lyskom-current-conf kom-review-uses-cache kom-read-depth-first lyskom-to-do-list] 11) kom-view-next-text() lyskom-next-command() #<compiled-function nil "...(57)" [lyskom-last-viewed overlay pos-visible-in-window-p lyskom-next-command move-to-window-line -1 lyskom-set-last-viewed lyskom-scroll window-start make-extent nil 1 set-extent-priority 1000 set-extent-face kom-mark-face add-timeout 2 delete-extent] 4 ("/home/neotron/elisp/lyskom-swedish-0.47.elc" . 1402374) nil>() call-interactively(kom-next-command) recursive-edit() byte-code("..." [print-escape-newlines print-length debugger-buffer debugger-value standard-output debugger-args pop-to-buffer erase-buffer t 50 backtrace debugger-mode re-search-forward "\n[* ] debug(" 1 debugger-reenable (lambda debug) "Entering:\n" debug backtrace-debug 3 delete-char ?* 0 exit "Return value: " prin1 ?\n ?\ error "Signaling: " "Beginning evaluation of function call form:\n" nil message "" recursive-edit buffer-read-only inhibit-trace] 3) debug(error (undefined-keystroke-sequence [#<keypress-event n> #<keypress-event meta->>]))
XEmacs 21.4.6, klient-version 0.47. Inlägget läsmarkeras inte heller kan jag tillägga.
/ David Hedbor (I live in interesting times)
Previous text:
2002-09-30 14:32: Subject: Bilaga (index.htm) till: Fw: can anybody help me
<expire-time now>
<html> <head> <title> party </title> <meta name="Generator" content="core-lv"> <meta name="Author" content="Joel Wella"> </head>
<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">
<br><br>
<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center"> <TR> <TD> <p><font size="2" face="Arial">Images are located under these folders.Open folder to start image processing - so it will generate thumbnails from large images. Also you can click on some image to open it in larger format. After that you will be able to set some image settings like: invert image, lighten image and desaturate image. Textual buttons are located top on the page. Anyway there is lot of options and possibilities.</font></p> <p><font face="Arial" size="2">there is shown only basic processing. (this is DEMO PAGE1)</font></p> </TD> </TR> </TABLE>
<br>
<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284"> <tr> <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample image processing from folders</font></td> </tr> <tr> <td valign="middle" align="center" bgcolor="#666666">
<table width="100" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> Select a folder:<br> <br> <?pike array dir = get_dir("/box1/demo/"); string st; int c; int size=sizeof(dir); for (c= 0; c < size; c++) { st = dir[c]; if (st!="babes") write(rxml("<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat="+st+"&page=1'>"+st+"</gtext><br><br>")); } ?> </td> </tr> </table>
</td> </tr> </table> <br>
<br> </body> </html>
/ Brevbäraren
Fixat i CVS och i 0.47.1 om någon får ändan ur och packar ihop en release. Om du stänger av visning av HTML så försvinner problemet. Är heller inte problem i Gnu Emacs.
/ David Byers
Previous text:
2002-09-30 19:15: Subject: Bilaga (index.htm) till: Fw: can anybody help me
När jag försöker läsa det kommenterade inlägget så får jag:
Signaling: (args-out-of-range #<buffer "kom.lysator.liu.se"> 662909 664760) make-extent(662909 664760) lyskom-limited-make-overlay(662909 664760) lyskom-format-insert-overlays(662909 (FORMAT-STATE . ["%#2$%#1t\n" 9 (... ...) 2 "<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>\n" nil (...) nil 0])) lyskom-format-insert("%#2$%#1t\n" ((TEXT-STAT . [9104889 ... 7871 67 1899 0 ... ...]) . "<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>") (face kom-text-body-face)) lyskom-print-text((TEXT-STAT . [9104889 (TIME . ...) 7871 67 1899 0 (... ...) (... ... ... ... ... ... ... ... ... ...)]) (TEXT . [9104889 "Bilaga (index.htm) till: Fw: can anybody help me\n<expire-time now>\n\n<html>\n<head>\n<title> party </title>\n<meta name="Generator" content="core-lv">\n<meta name="Author" content="Joel Wella">\n</head>\n\n<body bgcolor="black" text="#E5E5E5" link="#666666" vlink="#999999" alink="#666666">\n\n<br><br>\n\n<TABLE border="0" cellpadding="5" cellspacing="2" width="484" bgcolor="#333333" align="center">\n <TR>\n <TD>\n <p><font size="2" face="Arial">Images are located under these folders.Open \n folder to start image processing - so it will generate thumbnails from \n large images. Also you can click on some image to open it in larger format. \n After that you will be able to set some image settings like: invert image, \n lighten image and desaturate image. Textual buttons are located top on \n the page. Anyway there is lot of options and possibilities.</font></p>\n <p><font face="Arial" size="2">there is shown only basic processing. (this \n is DEMO PAGE1)</font></p>\n </TD>\n</TR>\n</TABLE>\n\n<br>\n\n<table width="528" border="0" cellspacing="0" cellpadding="0" align="center" height="284">\n <tr> \n <td height="15" valign="middle" align="center" bgcolor="#CCCCCC"><font size="" color="black">sample \n image processing from folders</font></td>\n </tr>\n <tr>\n <td valign="middle" align="center" bgcolor="#666666">\n \n<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">\n<tr>\n <td> Select a folder:<br>\n <br>\n<?pike\narray dir = get_dir(\"/box1/demo/\");\nstring st;\nint c;\nint size=sizeof(dir);\nfor (c= 0; c < size; c++)\n{\nst = dir[c];\nif (st!=\"babes\") write(rxml(\"<gtext font='robusticg' fontsize='15' bgcolor='#666666' magic-fgcolor='white' magic href='gallery.rxml?cat=\"+st+\"&page=1'>\"+st+\"</gtext><br><br>\"));\n}\n?>\n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<br>\n\n\n\n<br>\n</body>\n</html>"]) t 9104889 nil) lyskom-view-text(9104889 t t (CONF-STAT . [10353 "Pike (-) developers forum" (CONF-TYPE nil nil nil nil nil nil nil nil) (TIME . ...) (TIME . ...) 725 7430238 725 0 725 0 9999999 57 1 2620 0 nil]) 120 nil t nil) byte-code("..." [type read-list action text-no read-info lyskom-reading-list lyskom-tell-internat kom-tell-read next-text 0 lyskom-insert-string completely-read-conf not-in-any-conf nil 3 2 REVIEW-TREE (REVIEW REVIEW-MARK REVIEW-FAQ) delq cache-del-text-stat lyskom-view-text 1 (REVIEW REVIEW-MARK) lyskom-is-read read-list-delete-text is-review tri is-review-tree mark-as-read priority lyskom-current-conf kom-review-uses-cache kom-read-depth-first lyskom-to-do-list] 11) kom-view-next-text() lyskom-next-command() #<compiled-function nil "...(57)" [lyskom-last-viewed overlay pos-visible-in-window-p lyskom-next-command move-to-window-line -1 lyskom-set-last-viewed lyskom-scroll window-start make-extent nil 1 set-extent-priority 1000 set-extent-face kom-mark-face add-timeout 2 delete-extent] 4 ("/home/neotron/elisp/lyskom-swedish-0.47.elc" . 1402374) nil>() call-interactively(kom-next-command) recursive-edit() byte-code("..." [print-escape-newlines print-length debugger-buffer debugger-value standard-output debugger-args pop-to-buffer erase-buffer t 50 backtrace debugger-mode re-search-forward "\n[* ] debug(" 1 debugger-reenable (lambda debug) "Entering:\n" debug backtrace-debug 3 delete-char ?* 0 exit "Return value: " prin1 ?\n ?\ error "Signaling: " "Beginning evaluation of function call form:\n" nil message "" recursive-edit buffer-read-only inhibit-trace] 3) debug(error (undefined-keystroke-sequence [#<keypress-event n> #<keypress-event meta->>]))
XEmacs 21.4.6, klient-version 0.47. Inlägget läsmarkeras inte heller kan jag tillägga.
/ David Hedbor (I live in interesting times)
pike-devel@lists.lysator.liu.se