Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Image to SWF

by sulfericacid (Deacon)
on Feb 23, 2006 at 04:38 UTC ( [id://532166]=note: print w/replies, xml ) Need Help??


in reply to Re: Image to SWF
in thread Image to SWF

It took me a bit to get the module working. I installed SWF::Builder and it secretely needed Data::TemporaryBag.

Using your code I get an error now. The error is "Can't place the imported bitmap because it's size is unknown at swf.pl".

UPDATE Now I get an error that says it cannot get the height and width of the bitmap. I think it couldn't get the file before because I typed in the wrong file path. But now it can't get the dimensions. Is there a way for me to hack around it with image::info h&w params?

#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use lib "/home/everyday/public_html/lib"; use SWF::Builder; my $movie = SWF::Builder->new ( FrameRate => 15, FrameSize => [0, 0, 400, 400], BackgroundColor => 'ffffff' ); my $jpeg = $movie->new_jpeg('spyder_avie.jpg'); $jpeg->place; $movie->save('winter.swf');
Any idea what this error means? I tried tossing it at google but nothing is coming back.


"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^3: Image to SWF
by moklevat (Priest) on Feb 23, 2006 at 05:53 UTC
    This is really beyond my perlitude, but in looking at the relevant code in Bitmap.pm there seems to be a typo at line 85: $self->{_jepgdata} = $_[0];

    I suspect that it should be $self->{_jpegdata} = $_[0]; instead.

    Does changing this on your installation resolve the error?

    Here is the whole sub:
    sub JPEGData { my $self = shift; my $pos = 2; my $len = length($_[0]); $self->{_jepgdata} = $_[0]; while((my $s=substr($_[0], $pos, 2)) ne "\xff\xc0" and $pos < $len +) { $pos += 2+unpack('n', substr($_[0], $pos+2,2)); } croak "Can't get the width and height of JPEG data" if $pos>=$len; @{$self}{qw/_width _height/} = unpack('nn', substr($_[0], $pos+5,4 +)); undef $self->{_jpegfile}; $self; }
      No, that doesn't change the outcome unfortunately. My web host has agreed to try to install MING, if that goes well I think I'll go with that system instead.

      I appreciate all of your help, at least YOU got it working :)

      Someone outta make a ppm for this mod.



      "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: note [id://532166]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found