Giter Club home page Giter Club logo

gordon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gordon's Issues

Feature Request: Bookmarklet

This is a really cool project. You will rule the world if you create a bookmarklet that lets you use gordon to render swf files on-the-fly. This would help, for example, to render swf files on the iPhone that can't otherwise be seen at all.

Great Work!

Mike

Loading SWF from different site

Hi,
I was wondering if it would be possible to use Gordon to display an SWF on a different site than the web page it's on. From my understanding, JavaScript on one site can't access files on a different site(?). So does that mean it's impossible?
Thanks,

I can't get seem to make it work on the iphone?

I visited all your demo files on my iphone and they work flawlessly

I downloaded the javascript file (gordon.js) and droped it on a folder in the root of my site, then after that didn't work i dropped it in the root of my site.

I noticed the downloads section (gordon.js) is a bit different than the (gordon.js) file that is on your server. here; http://paulirish.com/work/gordon
does it matter which one i use?

I used one, then the other and both didn't work for me.
I also dropped the folder (src) with all the javascripts within it in the same root.

The code i used was:

<script type="text/javascript" src="temp/gordon.js"></script>
Replace me
<script type="text/javascript"> var movie = new Gordon.Movie("temp/Example.swf", {id: "Example", width: 480, height: 320}); </script> Example is the name of the swf file and is located in a folder named temp the gordon.js file is also located in that folder. Can you please help me understand how to use the Gordon Flash Actionscript to embed SWF files on my iPhone. The Swf files were created with Macromedia Flash 8

unzip/zlib isn't 100% reliable

I'm trying to use your zlib function to deflate image data and it's not coming out 100% correct. What I end up is about 90% of a the correct image, then 10% where it looks corrupted because there wasn't enough data.

For example, I'm deflating the alphaData on a JPG with alpha. The alphaData.length is 141,143 where as the number of pixels in the image is (imgData.data.length) is 141,198, so i'm missing 55 pixels worth of alpha data.

Any idea why this could be happening?

Images aren't handled properly

I'm using parts of gordon for parsing a swf and noticed that it doesn't handle images very well. Below is some adjusted code that handled everything (so far) except lossless pix15 and jpeg4 because i can't seem to create test scenarios. I figured since gordon has helped so much on my project it was only fit to return the favor.

        if(colorData) {
            var colorTableSize = obj.colorTableSize || 0,
                withAlpha = obj.withAlpha,
                bpp = (withAlpha || (obj.format == 5) ? 4 : 3),
                cmIdx = colorTableSize * bpp,
                pxIdx = 0,
                canvas = this.doc.createElement("canvas"),
                ctx = canvas.getContext("2d"),
                imgData = ctx.createImageData(width, height),
                pad = colorTableSize ? ((width + 3) & ~3) - width : 0;

            canvas.width = width;
            canvas.height = height;

            // If colorTableSize, then image is Colormapped
            // If no colorTableSize, then image is Direct

            // Without Alpha
            // (BitmapFormat 3) Colormapped Images are stored RGB, canvas uses RGBA
            // (BitmapFormat 4) Direct Images 15bit are UB[1] res, UB[5] red, UB[5] green, UB[5] blue
            // (BitmapFormat 5) Direct Images 24bit are UI8 res, UI8 red, UI8 green, UI8 blue

            // With Alpha
            // (BitmapFormat 3) Colormapped Images are stored RGBA, canvas uses RGBA
            // (BitmapFormat 5) Direct Images 32bit are stored ARGB, canvas uses RGBA
            if(obj.format == 4) colorData = new Flashbug.BytearrayString(colorData.join(''));

            for (var y = 0; y < height; y++) {
                for (var x = 0; x < width; x++) {
                    var idx = (colorTableSize ? colorData[cmIdx++] : cmIdx++) * bpp, r, g, b, a;
                    if(withAlpha) {
                        r = colorTableSize ? colorData[idx] : colorData[idx + 1];
                        g = colorTableSize ? colorData[idx + 1] : colorData[idx + 2];
                        b = colorTableSize ? colorData[idx + 2] : colorData[idx + 3];
                        a = colorTableSize ? colorData[idx + 3] : colorData[idx];
                    } else {
                        if(obj.format == 3) {
                            r = colorData[idx];
                            g = colorData[idx + 1];
                            b = colorData[idx + 2];
                        } else if(obj.format == 4) {
                            // Untested
                            colorData.readUB(1); // Reserved
                            r = colorData.readUB(5);
                            g = colorData.readUB(5);
                            b = colorData.readUB(5);
                        } else if(obj.format == 5) {
                            //colorData[idx]; // Reserved
                            r = colorData[idx + 1];
                            g = colorData[idx + 2];
                            b = colorData[idx + 3];
                        }
                        a = 255;
                    }

                    // BUG: Corrupted color data? (zlib?)
                    // had an image that wasn't the correct data size
                    // colorData.length = 65529
                    // imgData.data.length = 65536
                    // delta 7px
                    if(a) {
                        imgData.data[pxIdx] = r || 0; //R
                        imgData.data[pxIdx + 1] = g || 0; //G
                        imgData.data[pxIdx + 2] = b || 0; //B
                        imgData.data[pxIdx + 3] = a; //A
                    }
                    pxIdx += 4;
                }
                cmIdx += pad;
            }

            ctx.putImageData(imgData, 0, 0);
            uri = canvas.toDataURL();

            param.value.data = atob(uri.split(',')[1]);
        } else {
            uri = "data:image/jpeg;base64," + btoa(obj.data);

            // Moved to the image onload becuase of drawImage blowing up in Firefox
            /*if (obj.alphaData) {
                var img = new Image(),
                    canvas = this.doc.createElement("canvas"),
                    ctx = canvas.getContext("2d"),
                    len = width * height,
                    data = obj.alphaData;
                img.src = uri;
                canvas.width = width;
                canvas.height = height;

                //Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]
                ctx.drawImage(img, 0, 0); // <----- 

                var imgData = ctx.getImageData(0, 0, width, height),
                    pxIdx = 0;

                for (var i = 0; i < len; i++) {
                    imgData.data[pxIdx + 3] = data[i];
                    pxIdx += 4;
                }
                ctx.putImageData(imgData, 0, 0);
                uri = canvas.toDataURL();
            }*/
        }



        ///////////////// in image onload ///////////////////
        var canvas = this.doc.createElement("canvas"),
            ctx = canvas.getContext("2d"),
            len = w * h;
        canvas.width = w;
        canvas.height = h;

        ctx.drawImage(img, 0, 0);

        var imgData = ctx.getImageData(0, 0, w, h),
            pxIdx = 0;
            var counter = 0;
        for (var i = 0; i < len; i++) {
            var a = obj.alphaData[i];
            // BUG: Corrupted Alpha data? (zlib?)
            // had an image that wasn't the correct data size
            // alphaData.length = 141143
            // imgData.data.length = 141198
            // delta 55px
            if(a != undefined) imgData.data[pxIdx + 3] = a;
            pxIdx += 4;
        }

        ctx.putImageData(imgData, 0, 0);
        obj.hasAlpha = true; // Used a flag so when the image calls onload again, it won't mix in the alpha twice
        img.src = canvas.toDataURL();

Can't get it to work.

Hi,
I have downloaded the source and I just keep getting access denied all over the place when I try to execute the scripts. I am running Windows XP SP3 and have kept the directory structure of the ZIP file intact when extracting it.

Any ideas?

Wiki -> Compile?

Hello there,

would you please so kind and create a Wiki Page, where everybody can read out the tools need to be used for compiling gordon.js? (I tryed Ruby with http://rake.rubyforge.org... but failed)

Danke ( ;) ) & Regards,
HolmesSherlock

Gordon - installation on server...

which folders, files and root level must be uploaded to server to running Gordon?

root example:
www.somesite.com/demo/example.html

demo/srcipts/build/
demo/srcipts/src/
demo/srcipts/vendor/
demo/srcipts/gordon.js
demo/example.html
demo/example.swf

TobeyTaylor:
what would be the correct settings?

Kind regards

Does not work at all

I've copied all the files to my website, exactly as you have them in the demo. Nothing is working... Is there some sort of configuration I need to do? Thanks for your help!

demos down.

I get a "We couldn't find the page you were looking for." for every demo listed in the wiki

Newer Versions Support

Gordon is truly impressive but I was wondering, when do you think you'd have the support for the latest Flash features (currently support only goes up to Flash 2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.