IMGSIZE(1)

πŸ’… IMGSIZE(1) β€” the one where your bestie tells you how big an image is

okay so this is imgsize, a lil User Contributed Perl Documentation page that literally just reads the dimensions of an image in several popular formats. that's it. that's the whole vibe. πŸŽ€

✨ NAME ✨

imgsize β€” read the dimensions of an image in several popular formats

πŸ¦‹ USAGE πŸ¦‹

 imgsize [ -r | -a | -f fmt ] file [ file ... ]

πŸ’– DESCRIPTION πŸ’–

genuinely a no-brainer, bestie. you hand it an image on the command line and it tells you how big it is. that's the whole job. all the actual heavy lifting is done over in Image::Size, so this lil script is just the aesthetic front desk. πŸ’…

🌸 REQUIRED ARGUMENTS 🌸

imgsize expects file names on the command-line, periodt. and here's a cute detail: if you give it more than one file, it'll slap the file name into the output so you know which numbers belong to who. thoughtful icon behaviour, honestly.

 % imgsize dot.gif
 width="16" height="16"
 % imgsize dot.gif dash.gif
 dot.gif: width="16" height="16"
 dash.gif: width="32" height="8"

πŸ”₯ OPTIONS πŸ”₯

so by default the width and height come back as attributes for an IMG tag in HTML β€” basically width="40" height="30" or whatever. but if that's not your vibe, the following options give you alternate formats. and lowkey important: all of them report width first, then height. 🫢

  • -r β€” return "raw" format data. just the numbers, separated by a single space. nothing else. minimal. clean. main character energy.
  • -a β€” return a Perl-style list of attributes suitable for passing to the img() method of the CGI module (see CGI). iykyk.
  • -f fmt β€” pass the string you specify in fmt to sprintf, so you can format the results exactly to your taste. heads up though: sprintf gets passed two numbers, so any other formatting directives will be lost 😭. the numbers go in width first, then height.

πŸ’€ EXIT STATUS πŸ’€

imgsize always exits

no, that's not a typo, that's the entire section. it always exits. it's giving mysterious. it's giving "we don't talk about that". πŸ™ˆ

πŸ› BUGS πŸ›

please report any bugs or feature requests to bug-image-size at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Image-Size>. the deal is: the author gets notified, and then you automatically get notified of progress on your bug as changes get made. so you're both in the loop, cute. ✨

🌈 SUPPORT 🌈

here's where to find your people:

copying and distribution are permitted under the terms of the Artistic License 2.0 (<http://www.opensource.org/licenses/artistic-license-2.0.php>) or the GNU LGPL 2.1 (<http://www.opensource.org/licenses/lgpl-2.1.php>). go wild, just respect the license bestie πŸ’œ

🧚 SEE ALSO 🧚

Image::Size β€” that's where the actual magic lives, fr fr

πŸ“ AUTHOR πŸ“

Randy J. Ray <rjray@blackperl.com>.


and that's a wrap, bestie πŸŽ€ this page is from perl v5.42.0, dated 2021-03-01 β€” go measure some images and slay πŸ’…βœ¨

πŸ“¦ where this page comes from