http://qs321.pair.com?node_id=11145256


in reply to Image Uploader that Sizes the Photo Like An Avatar

Take a look at Image::Magick. Its description starts with (my emphasis):

"This Perl extension allows the reading, manipulation and writing of a large number of image file formats using the ImageMagick library. It was originally developed to be used by CGI scripts for Web pages."

A link to extensive documentation follows.

I believe that module only handles raster formats; but happy to be proven wrong (I did have a quick look for a list of available formats: couldn't find one). I routinely use Image::LibRSVG to convert SVG (a vector format) to raster formats; I've no idea if that would be useful for you.

— Ken

  • Comment on Re: Image Uploader that Sizes the Photo Like An Avatar

Replies are listed 'Best First'.
Re^2: Image Uploader that Sizes the Photo Like An Avatar
by perlfan (Vicar) on Jul 04, 2022 at 13:59 UTC
    Yes, Image::Magick will do this easily. I recommend actually, storing the full size image and hiding the resized image behind a webserver call (that might look like the all to an image or a RESTful GET call in an <img src...> tag. Note, image scale attacks exist, but I only mention them because they are an interesting adversary parlay against the bort.