Benjamin Otte
2007-Nov-12 18:45 UTC
[Swfdec] 3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_resource.c test/image
libswfdec/swfdec_image.c | 2 +- libswfdec/swfdec_resource.c | 1 + test/image/Makefile.am | 11 +++++++++++ test/image/load-jpeg-5.swf |binary test/image/load-jpeg-5.swf.png |binary test/image/load-jpeg-6.swf |binary test/image/load-jpeg-6.swf.png |binary test/image/load-jpeg-7.swf |binary test/image/load-jpeg-7.swf.org.png |binary test/image/load-jpeg-7.swf.png |binary test/image/load-jpeg-8.swf |binary test/image/load-jpeg-8.swf.png |binary test/image/load-jpeg.as | 27 +++++++++++++++++++++++++++ test/image/swfdec.jpg |binary 14 files changed, 40 insertions(+), 1 deletion(-) New commits: commit 0d05ac1e77bcdae08faabd31bea45f865b3fe926 Author: Benjamin Otte <otte at gnome.org> Date: Mon Nov 12 19:45:28 2007 +0100 typo diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c index 661e341..ee6aefc 100644 --- a/libswfdec/swfdec_image.c +++ b/libswfdec/swfdec_image.c @@ -471,7 +471,7 @@ swfdec_image_lossless_load (SwfdecImage *image) buffer->length = 0; swfdec_buffer_unref (buffer); } else { - SWFDEC_ERROR ("unknwon lossless image format %u", format); + SWFDEC_ERROR ("unknown lossless image format %u", format); return; } commit 96b2de5b024d90c5cb1e63a60f4c9ffa9c57d41e Author: Benjamin Otte <otte at gnome.org> Date: Mon Nov 12 18:53:40 2007 +0100 add image loading test diff --git a/test/image/Makefile.am b/test/image/Makefile.am index 0bf8a9a..d17d5b9 100644 --- a/test/image/Makefile.am +++ b/test/image/Makefile.am @@ -41,6 +41,16 @@ EXTRA_DIST = \ image-jpeg-alpha.swf.png \ image-lossless-alpha.swf \ image-lossless-alpha.swf.png \ + load-jpeg.as \ + load-jpeg-5.swf \ + load-jpeg-5.swf.png \ + load-jpeg-6.swf \ + load-jpeg-6.swf.png \ + load-jpeg-7.swf \ + load-jpeg-7.swf.org.png \ + load-jpeg-7.swf.png \ + load-jpeg-8.swf \ + load-jpeg-8.swf.png \ morph-gradient.c \ morph-gradient-4.swf \ morph-gradient-4.swf.png \ @@ -113,6 +123,7 @@ EXTRA_DIST = \ replace-shape-shape-6.swf.png \ replace-shape-shape-7.swf \ replace-shape-shape-7.swf.png \ + swfdec.jpg \ text-field-autosize.as \ text-field-autosize-6.swf \ text-field-autosize-6.swf.png \ diff --git a/test/image/load-jpeg-5.swf b/test/image/load-jpeg-5.swf new file mode 100644 index 0000000..b834f1d Binary files /dev/null and b/test/image/load-jpeg-5.swf differ diff --git a/test/image/load-jpeg-5.swf.png b/test/image/load-jpeg-5.swf.png new file mode 100644 index 0000000..7bc9ce3 Binary files /dev/null and b/test/image/load-jpeg-5.swf.png differ diff --git a/test/image/load-jpeg-6.swf b/test/image/load-jpeg-6.swf new file mode 100644 index 0000000..09fa843 Binary files /dev/null and b/test/image/load-jpeg-6.swf differ diff --git a/test/image/load-jpeg-6.swf.png b/test/image/load-jpeg-6.swf.png new file mode 100644 index 0000000..65f015e Binary files /dev/null and b/test/image/load-jpeg-6.swf.png differ diff --git a/test/image/load-jpeg-7.swf b/test/image/load-jpeg-7.swf new file mode 100644 index 0000000..5b7c2ee Binary files /dev/null and b/test/image/load-jpeg-7.swf differ diff --git a/test/image/load-jpeg-7.swf.org.png b/test/image/load-jpeg-7.swf.org.png new file mode 100644 index 0000000..db75b5f Binary files /dev/null and b/test/image/load-jpeg-7.swf.org.png differ diff --git a/test/image/load-jpeg-7.swf.png b/test/image/load-jpeg-7.swf.png new file mode 100644 index 0000000..83f685d Binary files /dev/null and b/test/image/load-jpeg-7.swf.png differ diff --git a/test/image/load-jpeg-8.swf b/test/image/load-jpeg-8.swf new file mode 100644 index 0000000..708a0de Binary files /dev/null and b/test/image/load-jpeg-8.swf differ diff --git a/test/image/load-jpeg-8.swf.png b/test/image/load-jpeg-8.swf.png new file mode 100644 index 0000000..83f685d Binary files /dev/null and b/test/image/load-jpeg-8.swf.png differ diff --git a/test/image/load-jpeg.as b/test/image/load-jpeg.as new file mode 100644 index 0000000..5efdda6 --- /dev/null +++ b/test/image/load-jpeg.as @@ -0,0 +1,27 @@ +// makeswf -v 7 -s 200x150 -r 1 -o load-jpeg.swf load-jpeg.as + +MovieClip.prototype.draw_rectangle = function (color) { + this.beginFill (color); + this.moveTo (0, 0); + this.lineTo (0, 100); + this.lineTo (200, 100); + this.lineTo (200, 0); + this.lineTo (0, 0); + this.endFill (); +}; + +createEmptyMovieClip ("a", 0); +a._x = 200; +a._y = 150; +a._rotation = 180; +l = new MovieClipLoader (); +l.loadClip ("swfdec.jpg", a); +l.onLoadInit = function (m) { + a.createEmptyMovieClip ("b", 0); + a.b._x = 50; + a.b._y = 50; + a.b.draw_rectangle (0xFFFF); + a.clear(); + a.draw_rectangle (0xFF); +}; + diff --git a/test/image/swfdec.jpg b/test/image/swfdec.jpg new file mode 100644 index 0000000..a3cc6e4 Binary files /dev/null and b/test/image/swfdec.jpg differ commit c8f9b6072cf5dd5e335dd7e24f130181f6ee3a5e Author: Benjamin Otte <otte at gnome.org> Date: Mon Nov 12 18:38:20 2007 +0100 also copy matrix to get _x and _y coordinate diff --git a/libswfdec/swfdec_resource.c b/libswfdec/swfdec_resource.c index d5be854..e066dc4 100644 --- a/libswfdec/swfdec_resource.c +++ b/libswfdec/swfdec_resource.c @@ -176,6 +176,7 @@ swfdec_resource_replace_movie (SwfdecSpriteMovie *movie, SwfdecResource *resourc mov->depth, mov->parent, resource, NULL, mov->name); if (copy == NULL) return FALSE; + copy->matrix = mov->matrix; copy->original_name = mov->original_name; copy->modified = mov->modified; copy->xscale = mov->xscale;