1 2 Previous Next 56 Replies Latest reply: Jun 21, 2009 8:39 AM by sectore RSS

    Request: Port AS3 Corelib encoder functionality

    matthewbmedia Community Member
      Ted Patrick had a post a while back asking the community about adding native encoder support to the player. Now that alchemy is available, would it make sense to move the functionality of the "corelib" as3 encoder libraries over to C++ equivalents?

      I currently have a client side publishing app that generates 300 dpi jpeg images out of bitmapdata objects, and even with a quad core 3ghz machine, encoding a jpeg using the AS3 corelib still takes 10-15 seconds.

      Would anyone at Adobe, or anyone in the community like to take a crack at bringing in a C++ jpeg encoder via alchemy? Is this possible?
        • 1. Re: Request: Port AS3 Corelib encoder functionality
          Manfred Weber
          I was asking me the same today. Actually I was researching for valid usecases. I think that Alchemy could speed up some slow algorithms like f.e. the encoder stuff you mentioned. Can anyone give some feedback on this?
          However I played with Alchemy today and hope to see some tests regarding performance.
          • 2. Re: Request: Port AS3 Corelib encoder functionality
            metalbot Community Member
            I'm taking a quick stab at it (downloaded http://www.ijg.org/files/jpegsrc.v6b.tar.gz , then ran ./configure on it.)

            It feels kinda weird to see that ./configure is repeatedly invoking AIR apps created on the fly to test if various features exist, but it works all the same.

            It compiled without a problem, and I know have a 377KB file named jpeg.l.bc.

            I still have to write some glue to call it from as3, but that shouldn't be a big deal, except I'll have to engage my brain long enough to learn what functions are exposed by the jpeg library.

            • 3. Re: Request: Port AS3 Corelib encoder functionality
              metalbot Community Member
              There appears to be little red ***** things hiding in my details.

              Various findings so far:

              - Using gluegen with functions that return a Boolean results in generated code that calls an AS3_Boolean() function. That function doesn't exist in the current release, although it's not hard to define an approximation of it as static AS3_Val AS3_Boolean(int val) { return val?AS3_True():AS3_False(); }

              - You can use "import" statements in .gg file, so you don't have to patch the resulting .as file afterward simply because you like ByteArrays.

              - However, gluegen-generated .as files don't seem to expose the .supplyFile() method and that does seem to require patching.

              - talking about .supplyFile(), the method works great to fake file reads, but is not written to handle file writes. That's a downer as libjpeg apparently wants to write encoded JPEG data into a FILE* structure.

              - minor quibble: if you're thinking of writing an AIR app with Alchemy that would read humongous files, don't. At least, not yet. The current implementation of open() reads the entire file in memory before returning a handle.

              - dead code removal isn't quite as good as I'd hope. whatever your glue file doesn't use gets compiled away. But that's it. The entire code in the final .swc will be included in any project that references it. That's probably because the CLibInit class hardcodes references to every other chunk in the .swc. So to optimize for size, you'll have to cut through your glue files and rebuild SWCs that contain only what you use.


              Anyway, at this point, I'm hoping I overlooked some way of using libjpeg without FILE* handles.
              • 4. Re: Request: Port AS3 Corelib encoder functionality
                matthewbmedia Community Member
                Thanks Metalbot for taking a stab at this. I was wondering if there would be hiccups in terms of passing a bytearray object off to be encoded by a jpeg library, as opposed to using a file reference. Please keep us updated on your progress! And anyone else feel free to chip in.

                I definitely think this would be a great provision from Adobe if anyone on the Adobe team wants to provide some killer-app-worthy sample libraries... ;-)
                • 5. Re: Request: Port AS3 Corelib encoder functionality
                  Branden_Hall
                  I'm not super familiar with GlueGen (when I started working with Alchemy it wasn't available yet) but I hope I can help a little bit.

                  The FILE* handles can be dealt with by using a C standare library function called funopen - this lets you create a file handle that goes and calls functions for read, write, lseek, and close.

                  http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=funopen
                  • 6. Re: Request: Port AS3 Corelib encoder functionality
                    joesteele Adobe Employee
                    Great feedback! I am looking into posting a sample of using libpng (the one demo'ed during MAX). It did not make it into the package unfortunately.

                    Regarding the various performance/codesize woes -- yes there are a bunch of improvements that can be made. If there is enough interest in the community we may get the chance to make them.

                    Regarding gluegen and AS3_Boolean -- yup -- that's a bug. It's on my queue now. Thanks.

                    Regarding gluegen and import -- yes -- that was my error in the README for as3_crypto_wrapper. I will try to put some docs together for gluegen and get them up which address this.

                    Regarding gluegen and supplyFile() -- hmm that should be exposed. I will investigate more.

                    Joe
                    • 7. Request: Port AS3 Corelib encoder functionality
                      metalbot Community Member
                      Alrighty, here's a simple wrapper around the encoding part of libjpeg.
                      It uses a custom destination manager (some semi-obscure libjpeg feature) to avoid the whole FILE* issue.

                      http://hurlant.com/as3_encoder_jpeg.tgz

                      You'll need to get libjpeg separately. there's a README.txt in my .tgz file that glosses over the steps.
                      • 8. Re: Request: Port AS3 Corelib encoder functionality
                        matthewbmedia Community Member
                        Thanks Joe -

                        yes! Yes there is interest!

                        An Adobe optimized library for encoding images would not only be a great demo of the capabilities of alchemy, it would actually have incredible real world use!

                        Send me your managers email address, and I will tell them to schedule more vacation time for you... :-)
                        • 9. Re: Request: Port AS3 Corelib encoder functionality
                          matthewbmedia Community Member
                          Thanks Metalbot!

                          I was hoping the speed would get better with larger byte arrays, but have only seen a linear comparison between the C and AS3 routines for encoding a jpeg.

                          Sadly the C version takes about 18 seconds to encode a 2400x2400 pixel bitmapdata bytearray, while the straight as3 version takes about 14 seconds.

                          I didn't notice any real bottlenecks in your implementation metalbot - but I'm definitely not a C guru - so maybe somebody from Adobe could take a look, as this would be a really good use case to test alchemy performance.
                          • 11. Re: Request: Port AS3 Corelib encoder functionality
                            metalbot Community Member
                            vevedh, I suspect the OpenSSH portable library would be a smoother ride.

                            You'd need to compile OpenSSL first (see the code sample Adobe made available for instructions on how to do that) and the zlib library.

                            Once you get the basic stuff compiled, you'd probably want to start hacking the C code a bit, as Alchemy's libc doesn't implement network-related commands yet. Also, calls to the zlib library should be replaced by builtin ByteArray methods where possible, to make things faster.

                            • 12. Re: Request: Port AS3 Corelib encoder functionality
                              matthewbmedia Community Member
                              Metalbot -

                              Thanks for your work on this. We might have a breakthrough... With the latest build of Alchemy, your test Files to encode a 2400x2400 bytearray have jumped from 18 seconds to 1.5 seconds on my machine!!! woohoo. I need to do some real world tests to verify this, but I'm running into issues compiling the swc into my projects FLA... Can't seem to get the compiler to find the cmodule package. Does anyone have any tips for me? I am sure I am missing something obvious - If I am limited to only compiling via the command line flex compiler, what can i do to compile my existing FLA...

                              On a separate note, how would one go about making this encoder behave asynchronously? It would be nice to break it up into 10% chunks - Or would there be too much overhead in sending progress information from the C layer back through to the actionscript layer?
                              • 13. Re: Request: Port AS3 Corelib encoder functionality
                                joesteele Adobe Employee
                                @matthewbmedia - You can use flyield() to release control back to Flash for processing events.
                                Here is an example from some code Scott wrote:

                                const int LoopSize = 20;

                                // don't let gcc inline you
                                void loopGuts(int loops) __attribute__((noinline));

                                // do the guts of the loop here -- unroll if you want
                                void loopGuts(int loops)
                                {
                                for(int j=0; j<loops; j++) {
                                // do a unit of processing
                                }
                                }

                                // here is your main looping routine
                                void bigLoop(int loops)
                                {
                                for(int i=0; i<loops; i++) {
                                if((loop % LoopSize) == 0)
                                flyield();
                                loopGuts(LoopSize);
                                }
                                }

                                The idea is that the inner "guts" routine will run synchronously and the outer routine will run asynchronously. Flash should be more responsive and you will still get most of the speed.
                                • 14. Re: Request: Port AS3 Corelib encoder functionality
                                  Darrin M
                                  I inserted a flyield call into metalbot's as3_jpeg_wrapper.gg and it didn't appear to make any difference, either to the performance of the encoding or the responsiveness of the UI. Encoding still halts UI and rendering. I've made other successful changes so I think I'm building it right.

                                  /* like reading a file, this time write one row at a time */
                                  while( cinfo.next_scanline < cinfo.image_height )
                                  {
                                  row_pointer[0] = &raw_image24[ cinfo.next_scanline * cinfo.image_width * cinfo.input_components];
                                  jpeg_write_scanlines( &cinfo, row_pointer, 1 );
                                  flyield();
                                  }
                                  • 15. Re: Request: Port AS3 Corelib encoder functionality
                                    matthewbmedia Community Member
                                    Thanks Joe for the tips -

                                    Does anyone from the community want to take a stab at tweaking the CPU load of this jpeg encoder routine? It is soooo close to being a usable asset for us all.

                                    Is there anything special about where a flyyield call needs to be placed for it to release a frame update to the flash end? Seems Ardnarf and I both are having issues implementing it into a while loop. I've added some checking to mine to iterate a counter and only run flyyield every 20 times through the loop - but it seems to have no effect.

                                    Metalbot -

                                    You also had a note in your C file read implementation about allocating memory on the file read, but never releasing it. What do you think would be the best thing to do here - is a manual call from the flash side needed to release / dispose of the file, or could something be placed at the end of the encode loop?
                                    • 16. Re: Request: Port AS3 Corelib encoder functionality
                                      joesteele Adobe Employee
                                      One additional bit -- Scott mentioned that the (noinline) attribute was not always working. You can tweak the gcc script in achacks to add your function to the $internsyms list. This should prevent the function from being inlined.
                                      • 17. Re: Request: Port AS3 Corelib encoder functionality
                                        ethan1el
                                        Guys, I am interesting in hiring a freelancer to make me this kind of flash applet. The basics required will be - resize before upload using this method (Alchemy + IJQ lib), ability to rotate and preview before upload.

                                        How much will it cost me? And is there anyone here interested to help me with this project?
                                        • 18. Re: Request: Port AS3 Corelib encoder functionality
                                          Bog Imp
                                          Hello
                                          (Sorry if noob questions)
                                          But i trying make work jpeg-6b on my pc but i have problems, can you help me?
                                          i have Win XP, simple test like "samples/stringecho/" or smth else work fine(compile c to swc).

                                          But when i try compile "jpeg-6b" i am stuck
                                          what i do:
                                          1.unpack
                                          2.open cygwin
                                          3.cd to folder and run
                                          $./configure
                                          4.wait all is ok i have "Makefile"
                                          5 when i try run
                                          $make
                                          i have troubles with
                                          "$ make
                                          MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
                                          rm -f libjpeg.a
                                          ar rc libjpeg.a jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o j
                                          cinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsam
                                          ple.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimi
                                          n.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o j
                                          dphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o j
                                          idctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomap
                                          i.o jutils.o jerror.o jmemmgr.o jmemnobs.o
                                          /usr/bin/ar: jcapimin.o: No such file or directory

                                          ** error 1 ** deleting libjpeg.a"
                                          Can you help me ?
                                          Also where i must take "jcapimin.o" and who must generate "jpeg.l.bc".
                                          • 19. Re: Request: Port AS3 Corelib encoder functionality
                                            notnick Community Member
                                            try this option
                                            1.open cygwin
                                            quote:

                                            tar xvf jpegsrc.v6b.tar.gz

                                            2.cd jpeg-6b
                                            quote:

                                            alc-on;./configure CFLAGS='-E';alc-off
                                            alc-on;make CFLAGS='-O3';alc-off
                                            alc-on;make clean;alc-off


                                            take jpeg.l.bc in the directory - /jpeg-6b

                                            • 20. Re: Request: Port AS3 Corelib encoder functionality
                                              Bog Imp Community Member
                                              when i run
                                              $alc-on;make CFLAGS='-O3';alc-off

                                              i have
                                              Bog Imp@imp /cygdrive/c/alchemy/samples/as3_encoder_jpeg/jpeg-6b
                                              $ alc-on;make CFLAGS='-O3';alc-off
                                              MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
                                              rm -f libjpeg.a
                                              ar rc libjpeg.a jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o j
                                              cinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsam
                                              ple.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimi
                                              n.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o j
                                              dphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o j
                                              idctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomap
                                              i.o jutils.o jerror.o jmemmgr.o jmemnobs.o
                                              /usr/bin/ar: jcapistd.o: No such file or directory

                                              ** error 1 ** deleting libjpeg.a
                                              • 21. Re: Request: Port AS3 Corelib encoder functionality
                                                notnick Community Member
                                                Check compiler:
                                                alc-on;gcc --help;alc-off
                                                that there can be seen?
                                                • 22. Re: Request: Port AS3 Corelib encoder functionality
                                                  notnick Community Member
                                                  if before doing. / configure
                                                  in the beginning, do make clean : alc-on;make clean;alc-off
                                                  • 23. Re: Request: Port AS3 Corelib encoder functionality
                                                    Bog Imp Community Member
                                                    $ alc-on;gcc --help;alc-off
                                                    Usage: llvm-gcc [options] file...
                                                    Options:
                                                    -pass-exit-codes Exit with highest error code from a phase
                                                    --help Display this information
                                                    --target-help Display target specific command line options
                                                    (Use '-v --help' to display command line options of sub-processes)
                                                    -dumpspecs Display all of the built in spec strings
                                                    -dumpversion Display the version of the compiler
                                                    -dumpmachine Display the compiler's target processor
                                                    -print-search-dirs Display the directories in the compiler's search path

                                                    ****

                                                    after that i try

                                                    Bog Imp@imp /cygdrive/c/alchemy/samples/as3_encoder_jpeg/jpeg-6b
                                                    $ alc-on;make clean;alc-off
                                                    MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
                                                    rm -f *.o *.lo libjpeg.a libjpeg.la
                                                    rm -f cjpeg djpeg jpegtran rdjpgcom wrjpgcom
                                                    rm -f ansi2knr core testout* config.log config.status
                                                    rm -f -r knr .libs _libs

                                                    Bog Imp@imp /cygdrive/c/alchemy/samples/as3_encoder_jpeg/jpeg-6b
                                                    $ alc-on;make;alc-off
                                                    MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
                                                    rm -f libjpeg.a
                                                    ar rc libjpeg.a jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o j
                                                    cinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsam
                                                    ple.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimi
                                                    n.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o j
                                                    dphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o j
                                                    idctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomap
                                                    i.o jutils.o jerror.o jmemmgr.o jmemnobs.o
                                                    /usr/bin/ar: jcapimin.o: No such file or directory

                                                    ** error 1 ** deleting libjpeg.a




                                                    • 24. Re: Request: Port AS3 Corelib encoder functionality
                                                      Bog Imp Community Member
                                                      Sorry for my offtope but i have problem with make its my delphi he also have "Make"
                                                      in result i try use delphi make in Cygwin
                                                      if you have mak and response
                                                      MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
                                                      Fatal: Unable to open makefile

                                                      It's delphi.
                                                      Now i install make from devel folder
                                                      seems work all corrects.....
                                                      • 25. Request: Port AS3 Corelib encoder functionality
                                                        piolo96 Community Member
                                                        hi Notnick I followed what you mentioned on post 46 and everything ran just right.
                                                        I was wondering what the next step for this to build the .swc file I need would be.
                                                        what am I suppose to do with the jpeg.l.bc in the directory - /jpeg-6b

                                                        Thanks so much for all the help.
                                                        • 26. Request: Port AS3 Corelib encoder functionality
                                                          notnick Community Member
                                                          Depending on the purpose:
                                                          if you write own module on Alchemy - С/C ++ for example example.c. Then use for compilation in SWC.
                                                          alc-on;gcc example.c -O3- Wall -swc -o example.swc -L.../jpeg-6b -ljpeg;alc-off
                                                          But if you ask in a theme context - look above...
                                                          The post from - Metalbot.There is a link on archive with an example and is used - Makefile.

                                                          quote:

                                                          There it is written - GLUEGEN a file (a mix "C(Alchemy)" and "AS3") with extention *.gg and accordingly all will be on another. Look an example at Metalbot and it Makefile

                                                          Process in this case the such:
                                                          It is taken separately "С" a part from gluegen *.gg a file - glue.c and AS3 a part glue.as
                                                          And in SWC it is compiled only - glue.c
                                                          glue.as It is used as a class in AS3.
                                                          • 27. Re: Request: Port AS3 Corelib encoder functionality
                                                            piolo96 Community Member
                                                            I tried doing what Metalbot sugested but as I went through it all and was on the last step to make the .swc file. This errors comes up:

                                                            ===================================================
                                                            Macintosh-2:jpeg-6b userName$ make
                                                            gcc -o cjpeg cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o cdjpeg.o libjpeg.a
                                                            ld warning: in cjpeg.o, file is not of required architecture
                                                            ld warning: in rdppm.o, file is not of required architecture
                                                            ld warning: in rdgif.o, file is not of required architecture
                                                            ld warning: in rdtarga.o, file is not of required architecture
                                                            ld warning: in rdrle.o, file is not of required architecture
                                                            ld warning: in rdbmp.o, file is not of required architecture
                                                            ld warning: in rdswitch.o, file is not of required architecture
                                                            ld warning: in cdjpeg.o, file is not of required architecture
                                                            ld warning: in libjpeg.a, file is not of required architecture
                                                            Undefined symbols:
                                                            "_main", referenced from:
                                                            start in crt1.10.5.o
                                                            ld: symbol(s) not found
                                                            collect2: ld returned 1 exit status
                                                            make: *** [cjpeg] Error 1
                                                            ===================================================

                                                            Step 5 when it says to run make. That is when the error comes up.

                                                            thanks in advance for any help.

                                                            • 28. Re: Request: Port AS3 Corelib encoder functionality
                                                              notnick Community Member
                                                              Open a file in HEX editor, for example cjpeg.o -- The first two bytes must be 00000000h: 42 43; or in text two simbol - BC.
                                                              This is necessary. LLVM unnecessarily just to understand its format.
                                                              How did you met -. / Configure?
                                                              Have alc-on; with this?
                                                              • 29. Request: Port AS3 Corelib encoder functionality
                                                                piolo96 Community Member
                                                                I followed the following:
                                                                Download jpegsrc.v6b.tar.gz
                                                                Through terminal I ran the following lines:
                                                                tar xvf jpegsrc.v6b.tar.gz
                                                                cd jpeg-6b
                                                                alc-on;./configure CFLAGS='-E';alc-off
                                                                alc-on;make CFLAGS='-O3';alc-off
                                                                alc-on;make clean;alc-off

                                                                After this steps I followed the steps on the Metabolt link.
                                                                Make a new directory jpeg
                                                                take jpeg.l.bc in the directory - /jpeg
                                                                Go on to the directory jpeg
                                                                run the following:
                                                                cd ../jpeg-6b
                                                                make

                                                                After this I get the error that I already mentioned in the last post.
                                                                I did open the file jpeg.l.bc on a HEX Editor and got the (42, 43) which in symbol would be BC at the beginning

                                                                Any suggestions on what I am doing wrong? Any help would be greatly appreciated.

                                                                Thanks for all the help.
                                                                • 30. Re: Request: Port AS3 Corelib encoder functionality
                                                                  notnick Community Member
                                                                  Sorry for the Mac may be what is the option(
                                                                  I will try later on MAC OS)
                                                                  try to install VirtualBox with Ubuntu8.10 and it works there fine.
                                                                  • 31. Re: Request: Port AS3 Corelib encoder functionality
                                                                    myMacromediaScreenName Community Member
                                                                    radScientist, Metalbot

                                                                    Confirming approximately 1.5 sec on a Windows dual core 2.1 GHz.
                                                                    • 32. Re: Request: Port AS3 Corelib encoder functionality
                                                                      notnick Community Member
                                                                      Today checked alchemy to MAKOSX-leo10.5
                                                                      Everything works fine
                                                                      The latest version of Xcode 3.1.2
                                                                      i686-apple-darwin9-gcc-4.0.1
                                                                      perl, v5.8.8
                                                                      java version "1.5.0_16"
                                                                      Edit the file: / private / etc / bashrc
                                                                      PATH=/Users/tester/flex_sdk_3/bin:$ALCHEMY_HOME/achacks:$PATH
                                                                      source /Users/tester/alchemy/alchemy-setup
                                                                      • 33. Re: Request: Port AS3 Corelib encoder functionality
                                                                        MB2 Community Member
                                                                        For us here just joining the thread could we get a summary of what is working (and what is not working) on the jpeg encoder port / build with Alchemy on Windows? Perhaps an overview of what stage the port is at? Working, or not... -MB
                                                                        • 34. Re: Request: Port AS3 Corelib encoder functionality
                                                                          notnick Community Member

                                                                          You can port the library from source http://www.ijg.org/files/, in LLVM c help - alchemy sdk (on any OS-mac, windows, linux), and connect to jpeg.l.bc project alchemy.
                                                                          For example - you can take the archive from Metalbot (see above) and try.
                                                                          This example works and converts Bitmap array of jpeg.
                                                                          How fast compared to AS3/Alchemy? a little faster:)
                                                                          But speed - This is the main goal.
                                                                          Alchemy has not yet been released. Let's wait for improvements, and especially support for multithreading - today, this important function is turned off. Why? Let us ask the support ... to the MAX2007 is shown;)
                                                                          • 35. Re: Request: Port AS3 Corelib encoder functionality
                                                                            piolo96 Community Member
                                                                            Thanks notnick for all that, hey myMacromediaScreenName you mentioned you were able to successfully test the jpeg lib, I was wondering if you could share with us the c file you used to compile the swc. I been trying something here and there but haven't gotten any results yet. thanks a lot
                                                                            • 36. Re: Request: Port AS3 Corelib encoder functionality
                                                                              notnick Community Member
                                                                              This is a project of Metalbot
                                                                              file included
                                                                              i am change in make flag -O5
                                                                              test results
                                                                              AS3 JPEG ENCODING: 606ms.
                                                                              jpg.length = 2362
                                                                              setting up as3_jpeg_wrapper library
                                                                              C JPEG ENCODING: 206ms.
                                                                              • 37. Re: Request: Port AS3 Corelib encoder functionality
                                                                                piolo96 Community Member
                                                                                great example notnick thank you very much. did you ever run into a problem with the jpeg_std_error().

                                                                                Undefined sym: _jpeg_std_error
                                                                                at <anonymous>()
                                                                                at <anonymous>()
                                                                                at com.hurlant.jpeg::as3_jpeg_wrapper$/write_jpeg_file()[/Users/user/Documents/Flex Builder 3/jpegTest/src/com/hurlant/jpeg/as3_jpeg_wrapper.as:8]
                                                                                at jpegTest/testWrite()[/Users/user/Documents/Flex Builder 3/jpegTest/src/jpegTest.mxml:32]
                                                                                at jpegTest/___jpegTest_Button1_click()[/Users/user/Documents/Flex Builder 3/jpegTest/src/jpegTest.mxml:44]

                                                                                I tried this example with your swc then I went and compiled it myself to double check. When I did, I ran into this. I made sure I had my jpeg-6b library installed and on the right path and everything looks right, I dont have any error in the moment of compiling. thank you
                                                                                • 38. Re: Request: Port AS3 Corelib encoder functionality
                                                                                  notnick Community Member
                                                                                  I do not compile in Flex project.Actionscript project is only. SWC does not require libraries.
                                                                                  This is the fully compiled.
                                                                                  • 39. Re: Request: Port AS3 Corelib encoder functionality
                                                                                    piolo96 Community Member
                                                                                    I am not sure I understand what you are saying. Once the SWC is compiled I use it on my Flash / Flex projects. You mean you did not use the jpeg library on your project? I think you did because on the .gg file you have the line in which you include the jpeg lib (#include <jpeglib.h>) and then you are using this dealing with the ByteArray you pass into it through the write_jpeg_file method. Does that make any sense? My issue is that even though I do include this file and it seems to be working correctly, for some reason I have some limits on using it because I can't use any methods that this is supposed to bring in.
                                                                                    Thank you.
                                                                                    1 2 Previous Next