It seemed to me that you need is an example:) I gave this as
there is a project of "Metalbot"
My there's nothing:)
I can compile jpeg.l.bc but I just did not handle the porting
of alchemy.
Accordingly, you will need for this example of "Metalbot"
(perhaps it will appear here) to write a class in C -alchemy where
the will support any metod of the library

yes if you could, that would be awesome. What do we need to
compile the jpeg.l.bc for? what's the use for it? And if you could
please help me on why I can't seem to be able to use jpeg lib or
any other lib that'd be great!

The fact that you can write in C you can not write in AS3.
To use C libraries, together with AS3 - using C alchemy.
To do this you need to compile the C library in alchemy and
write a class in C Alchemy serves as a mediator between the C
and AS3.
Where a minimum must be agreed upon data types.
You can see an example of Metalbot in action.
Or that it does not work?
If you write something to show the code for clarity.

I did try Metabolt's sample in action. It does work, BUT at
the moment I compile the C file that serves as the mediator with
Alchemy to build a new SWC file, and it does not work. Metabol are
you around? Can you get in here and explain me why my JPEG library
is not getting compiled or something. I have a very simple example
that I apply standard alchemy methods but as soon as I start
writing some of the lines of Metabolts C file, it throws me an
error. The error that I mentioned before,, like 2 posts ago. Here
we go:
jpegCompressionIf you could take a look at that and tell me where I went
wrong, and how will I be able to use the jpeg lib for the
compression of images that would be great.
Thank you

It is clear now.
A few questions I do not see the logic in your application
where load jpg. What goal? Decoding? Resizing?
At the moment I run your example but I do not see any errors.
If it is possible to give exact information.
From the documentation for the jpeg-6b note:

quote:
We provide a set of library routines for reading and writing
JPEG image files,
plus two sample applications "cjpeg" and "djpeg", which use
the library to
perform conversion between JPEG and some other popular image
file formats..

Ok so now that you have seen what I have done. The purpose of
the application is to resize images down from however big they are,
bring them down to usable size. On my C file if you look from line
83 to 109 they are commented out. These are the methods I believe I
will be using with the jpeg lib to make it happen. The main issue
is that the library is just not working for me and I am not able to
get it working. I am using what the "cjpeg" would apply to compress
a image to jpeg format, only difference is I am getting a
ByteArray, making it into a file so that I could inserted and used
on the library. Hope that helps.

AS3 JPEG ENCODING: 1199ms.
jpg.length = 17388
setting up as3_jpeg_wrapper library
C JPEG ENCODING: 245ms.
ret.length=8963
But still need to resize the image. Probably what is the
manipulation of the Matrix. Unfortunately this has not happened.
But mostly it works.

cool man that's great so we got the AS3 part covered. I
appreciate the help. Now the C part where I got to use the library
and apply some kind of routine to compress the image and spit it
back out the ByteArrat so that I could use the compressed image in
my flash application. That's the part where I am struggling. Thanks
again

All ok! I was interested but there is the main point
I noticed that the real picture is very big difference in
speed, between AS3 and Alchemy
I do not deepened in the reasons. But look at it.
AS3 JPEG ENCODING: 1199ms.
C JPEG ENCODING: 245ms.
In the original example, where used only generic BitmapData
differences were much smaller.
AS3 JPEG ENCODING: 606ms.
C JPEG ENCODING: 206ms.
It seemed to me that you have a problem with C? You can not
use the library? What are the causes?

In the function write_jpeg_file is all the functionality that
will be used later on in flash / flex through the .SWC file.

Now when I try to compile this .gg file with gluegen and then
through gcc, to make a NEW as3_jpeg_wrapper.swc that should be just
like MetalBot original .SWC file. I do not seem to get any error
compiling, BUT at the moment I go into flash and replace the new
SWC for the old and test the swf movie, it throws me an error,

Undefined sym: _jpeg_std_error
at <anonymous>()
at <anonymous>()

According to the Undefined sym: _jpeg_std_error, that would
have to do with the line cinfo.err = jpeg_std_error( &jerr );
I never changed a thing from this file and so that is the
main issue I have. Without changing a thing, a project that was
working properly, I just recompiled the SWC and it does not work
anymore. I hope this makes everything clear.

Is there a way you could walk me through the way you get to
the end of it ( the whole process).
(assuming we don't have the jpeg lib installed) Starting from
the point where we download MetalBot's project and we start
building from the as3_jpeg_wrapper.gg he has until we get the
as3_jpeg_wrapper.swc and we go inside flash / flex and try it with
the JpegTest.as