From: Robert Maas, http://tinyurl.com/uh3t
Subject: Trying to find a library that supports parsing/generating JPEG files
Date: 
Message-ID: <REM-2008nov19-001@Yahoo.Com>
Looking in various repositories of CL code to try to find a module
that allows me to read an existing JPEG file to obtain an array of
pixels, and to generate a lossy-compressed JPEG file from such an
array of pixels.

http://www.common-lisp.net/
->
   Linkname: CL Directory
        URL: http://www.cl-user.net/
->
   Linkname: [arblue.gif] By Topic
        URL:
          http://www.cl-user.net/asp/Il7o/sdataQ03jMISYQy7GDQjr-br2Rxqk8y
          BX8yBX8oQ5/sdataQu3F$sSHnB==
->
   Linkname: [arblue.gif] Graphics
        URL:
          http://www.cl-user.net/asp/S$7o/sdataQ03jMISYQy7GDQjr-br2$7dk8y
          BX8yBX8oQ5/sdataQu3F$sSHnB==
There's a JPEG meta-data module, but there's no software to
read the actual data (virtual pixel array) from a JPEG file.

http://clocc.sourceforge.net/
I can't find any list of categoies of software whatsoever.

http://www.cliki.net/
->
   Linkname: Download ASDF package from
        URL: http://www.common-lisp.net/project/mcclim/cl-jpeg.tar.gz
Downloaded cl-jpeg, gunzip, tar-x, tried to compile-file but
got a spew of 5630 lines (236383 bytes) of output (warnings
etc.), which I saved here:
 <http://www.rawbw.com/~rem/NewPub/jpeg-comp.txt>

http://members.cox.net/vogt/jpeg.lisp
Downloaded, and tried to compile:
* (compile-file "jpeg.lisp")
Python version 1.0, VM version Intel x86 on 19 NOV 8 02:14:48 pm.
Compiling: /home/users/rem/Tmps/TmpJpeg2/jpeg.lisp 19 NOV 8 02:11:18 pm
Error in function KERNEL::INVALID-ARRAY-INDEX-ERROR-HANDLER:
   Invalid array index, 1 for ".".  Should have been less than 1
Restarts:
  0: [ABORT] Return to Top-Level.
Debug  (type H for help)
(COMMON-LISP::VECTOR-SUBSEQ* "." 0 #<unavailable-arg>)
0] backtrace
0: (COMMON-LISP::VECTOR-SUBSEQ* "." 0 #<unavailable-arg>)
1: (C::NORMAL-READ-ERROR
    #<Stream for file "/home/users/rem/Tmps/TmpJpeg2/jpeg.lisp">
    2375
    #<READER-ERROR {9073925}>)
2: (C::CAREFUL-READ
    #<Stream for file "/home/users/rem/Tmps/TmpJpeg2/jpeg.lisp">
    (C::*EOF*)
    2375)
3: (C::PROCESS-SOURCES #<Source-Info>)
4: (#:G0)
5: (C::SUB-COMPILE-FILE #<Source-Info> NIL)
6: (C::SUB-COMPILE-FILE 1 #<Source-Info> 335806303)[:EXTERNAL]
7: (COMPILE-FILE "jpeg.lisp" :OUTPUT-FILE T :ERROR-FILE ...)
8: (INTERACTIVE-EVAL (COMPILE-FILE "jpeg.lisp"))
9: (COMMON-LISP::%TOP-LEVEL)
10: (COMMON-LISP::RESTART-LISP)

From: Thomas A. Russ
Subject: Re: Trying to find a library that supports parsing/generating JPEG files
Date: 
Message-ID: <ymik5azpb01.fsf@blackcat.isi.edu>
·············@teh.intarweb.org (Robert Maas, http://tinyurl.com/uh3t) writes:

Well, there's CL-Magick 

  http://common-lisp.net/project/cl-magick/

But I suspect that your system is far too old to be able to run the
ImageMagick library that this code requires.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Robert Maas, http://tinyurl.com/uh3t
Subject: Re: Trying to find a library that supports parsing/generating JPEG files
Date: 
Message-ID: <REM-2008nov21-001@Yahoo.Com>
> From: ····@sevak.isi.edu (Thomas A. Russ)
> Well, there's CL-Magick
>  http://common-lisp.net/project/cl-magick/

OK, I downloaded that, gunzip, and tar-xf, and now I have a bunch
of files with no instructions how to install them nor how to use
them. Is there anybody reading this thread who has ever used this
package and can tell me how to install/use it? For example, which
of the several lisp files should I compile before trying to use?
Then which file(s) should I load, in which sequence? Then what
function do I need to call to parse a JPEG file to produce a Lisp
array containing the pixel values?
From: Pascal J. Bourguignon
Subject: Re: Trying to find a library that supports parsing/generating JPEG files
Date: 
Message-ID: <7cbpw9kur2.fsf@pbourguignon.anevia.com>
·············@teh.intarweb.org (Robert Maas, http://tinyurl.com/uh3t) writes:

>> From: ····@sevak.isi.edu (Thomas A. Russ)
>> Well, there's CL-Magick
>>  http://common-lisp.net/project/cl-magick/
>
> OK, I downloaded that, gunzip, and tar-xf, and now I have a bunch
> of files with no instructions how to install them nor how to use
> them. Is there anybody reading this thread who has ever used this
> package and can tell me how to install/use it? For example, which
> of the several lisp files should I compile before trying to use?
> Then which file(s) should I load, in which sequence? Then what
> function do I need to call to parse a JPEG file to produce a Lisp
> array containing the pixel values?

The instructions are given in the cl-magick.asd file.

To know how to understand this  cl-magick.asd  file, you could read the explainations givein at:
http://cclan.cvs.sourceforge.net/viewvc/cclan/asdf/asdf.lisp?revision=1.130&view=markup


-- 
__Pascal Bourguignon__
From: D Herring
Subject: Re: Trying to find a library that supports parsing/generating JPEG files
Date: 
Message-ID: <gg2hcl$et2$1@aioe.org>
Robert Maas, http://tinyurl.com/uh3t wrote:
> Looking in various repositories of CL code to try to find a module
> that allows me to read an existing JPEG file to obtain an array of
> pixels, and to generate a lossy-compressed JPEG file from such an
> array of pixels.
...
>    Linkname: Download ASDF package from
>         URL: http://www.common-lisp.net/project/mcclim/cl-jpeg.tar.gz
> Downloaded cl-jpeg, gunzip, tar-x, tried to compile-file but
> got a spew of 5630 lines (236383 bytes) of output (warnings
> etc.), which I saved here:
>  <http://www.rawbw.com/~rem/NewPub/jpeg-comp.txt>

I dunno, hundreds of optimization notes and a few warnings doesn't 
seem like a reason to abandon cl-jpeg.

This seems to be the items of interest:
""
In: DEFUN DECODE-CHUNK
   (POSITION CID (DESCRIPTOR-CID IMAGE))
--> DO BLOCK LET TAGBODY RETURN-FROM
==>
   (PROGN NIL)
Warning: This is not a FIXNUM:
   NIL
[Last message occurs 2 times]

   (POSITION (FIRST (SVREF # COMP)) (DESCRIPTOR-CID IMAGE))
--> DO BLOCK LET TAGBODY RETURN-FROM
==>
   (PROGN NIL)
Warning: This is not a FIXNUM:
   NIL
...
Note: Unable to recode as shift and add due to type uncertainty:
       The first argument is a FIXNUM, not a (UNSIGNED-BYTE 32).
       The result is a FIXNUM, not a (UNSIGNED-BYTE 32).
...
Note: Forced to do full call.
...
Note: DYNAMIC-EXTENT declaration not implemented.
...
In: DEFUN INTERPRET-MARKERS
   (READ-COM S)
Warning: Undefined function: READ-COM


In: DEFUN MAKE-NEXTBIT
   (READ-BYTE S)
--> BLOCK LET IF LET
==>
   (EXTENSIONS:STREAM-READ-BYTE STREAM)
Warning: Undefined function: EXTENSIONS:STREAM-READ-BYTE


Warning: These functions are undefined:
   READ-COM EXTENSIONS:STREAM-READ-BYTE


Compilation unit finished.
   6 warnings
   663 notes


jpeg.x86f written.
Compilation finished in 0:00:29.
""

I agree with the compiler that the read-com thing is shady; but 
stream-read-byte and (PROGN NIL) appear to be artifacts of your lisp 
implementation.

In comparison, SBCL is telling me

; compilation unit finished
;   caught 41 STYLE-WARNING conditions
;   printed 601 notes


Have you tried running this library and found that it didn't work? 
What are your (lisp-implementation-type) and 
(lisp-implementation-version)?  CMUCL something?

I'm somewhat interested in polishing cl-jpeg.

Thanks,
Daniel