Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

JPG TO SWF

by sulfericacid (Deacon)
on Mar 07, 2006 at 07:48 UTC ( [id://534850]=perlquestion: print w/replies, xml ) Need Help??

sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:

After endless searches through example code and documentation online (although there is very little), I can't get ANY example to work for either SWF::File or SWF::Builder to load an image.

The code compiles but always errors out that it cannot get the image height or width. The location to the image are correct and the permissions on my web site are correct. It just won't load any images.

All other code works fine. I can output shapes and all that good stuff, but not images.

Does anyone have a working example of this?

#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; print header, start_html(); use SWF::Builder; my $movie = SWF::Builder->new ( FrameRate => 15, FrameSize => [15, 15, 400, 400], BackgroundColor => 'ffffff' ); my $jpeg = $movie->new_jpeg('100.jpg'); $jpeg->place; $movie->save('winter.swf');


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re: JPG TO SWF
by marto (Cardinal) on Mar 07, 2006 at 09:35 UTC
Re: JPG TO SWF
by zentara (Archbishop) on Mar 07, 2006 at 12:06 UTC
    Use SWF::File for jpg-2swf. There is a script to do this in the module's samples directory.

    I'm not really a human, but I play one on earth. flash japh
      I've used the two samples in that directory for SWF::File and it errors out saying it cannot get the dimensions for my image. The image path and permissions are right, but no matter what jpg I try to open in any folder, it won't load it.



      "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

      sulfericacid
        It works here for me on linux, I don't know what to tell you. I have seen some images that are not written correctly, that most viewers will load, but some Perl modules choke on them. Maybe try a different image?

        I'm not really a human, but I play one on earth. flash japh
Re: JPG TO SWF
by moklevat (Priest) on Mar 07, 2006 at 17:58 UTC
    This has got to be very frustrating for you, but I think I have a solution.

    It was working fine on my linux and Win boxes before. However, it looks like version 0.14 of SWF::Builder has some problems that weren't present in version 0.09. I was unable to get 0.14 to pass the tests on my linux box, and if I force installation your script breaks. I notice also that Activestate PPM has version 0.09 despite the availability of a newer version. When I downloaded Version 0.09 and installed it over 0.14 the script works again. I hope this solves things for you.

      Oh I hope this is the problem :)

      I emailed my web host and asked them to install http://search.cpan.org/~ysas/SWF-Builder-0.09/ over the version they had. I'll let you know how this turns out.

      Thank you!



      "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

      sulfericacid
        UPDATE

        My web host installed .09 and it functions better than the newest version. However, only 1 image out of my some 1300 actually works with it. I must say I am very disappointed with the SWF* series of modules with their lack of image support.

        Someday someone will create modules that perform SWF tasks, until then I guess I'm stuck!

        Thanks for your help everyone



        "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

        sulfericacid

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://534850]
Approved by bart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found