[Catalyst] Forms and Plugins and Tutorials, oh my!!
    Jonathan Rockway 
    jon at jrock.us
       
    Thu Aug 17 19:39:58 CEST 2006
    
    
  
I am writing a plugin to do this as we speak.  Expect it to hit CPAN by
the end of the weekend.  The API looks something like:
my $image = $c->register_image('/path/to/the/image');
$image will have methods like $image->url that return a fully-qualified
URL that your web server can statically serve the image from.  You can
also expire the images, delete them, get a scaled version (for exciting
AJAX scaling effects; yay), etc.
The details aren't completely worked out yet, though, and are subject to
major changes.  (This was going to be a Controller in my app, but I
guess a plugin is more useful to others.  Major change #1 :)
> And now I have a couple of image plugin related questions.  Are there any
> Catalyst plugins to help deal with uploaded images?  I'm looking for
> something along the lines of:
> 
>   1.  Generate a random name to avoid duplicate filename conflicts and move
>       the uploaded image to an image directory.
> 
>   2.  Generate a thumbnail for the image.
> 
>   3.  Store the needed image path and size info in a database.
> 
>   4.  Helper functions to spit out an appropriate image tag in a template
>       for images in the database.
>
"Images in the database"?  Depending on what these are, you might want
to look up URI::data.
data:text/x-perl,print%20%22Just%20another%20Catalyst%20hacker.%22
-- 
Jonathan Rockway
    
    
More information about the Catalyst
mailing list