JPEG(3pm)

Okay bestie, welcome to JPEG(3pm) β€” the Imager::File::JPEG manual page from the User Contributed Perl Documentation crew, and it's literally about reading and writing JPEG files. ✨

🌸 NAME 🌸

Imager::File::JPEG β€” read and write JPEG files. No cap. πŸ’–

✨ SYNOPSIS ✨

Here's the whole vibe in code, bestie:

use Imager;

my $img = Imager->new;
$img->read(file=>"foo.jpg")
  or die $img->errstr;

$img->write(file => "foo.jpg")
  or die $img->errstr;

my $version = Imager::File::JPEG->libjpeg_version();
if (Imager::File::JPEG->is_turbojpeg) { ... }
if (Imager::File::JPEG->is_mozjpeg) { ... }

if (Imager::File::JPEG->has_arith_coding) { ... }

πŸ’… DESCRIPTION πŸ’…

Imager's JPEG support is documented in Imager::Files. That's the main-character doc, go read it. 🫢

Besides providing JPEG support, Imager::File::JPEG has the following methods:

🧚 libjpeg_version() 🧚

Imager::File::JPEG->libjpeg_version();

Returns version information about the variety of libjpeg that Imager::File::JPEG was compiled with. This is determined at build time, bestie. It includes:

  • The library type, one of libjpeg, libjpeg-turbo or mozjpeg. πŸ‘‘
  • version followed by the library version number. πŸ”₯
  • api followed by the libjpeg API version. ✨

For libjpeg the API and library versions are always equal. Periodt.

πŸ¦‹ is_turbojpeg() πŸ¦‹

Imager::File::JPEG->is_turbojpeg();

Returns true if Imager::File::JPEG was built with libjpeg-turbo. Note that mozjpeg is built on top of libjpeg-turbo, so this will return true for mozjpeg. πŸ’€

πŸŽ€ is_mozjpeg() πŸŽ€

Imager::File::JPEG->is_mozjpeg();

Returns true if Imager::File::JPEG was built with mozjpeg. Note that mozjpeg doesn't define its own version numbering, so mozjpeg is detected by defines that only mozjpeg currently defines. Iykyk. 🌈

πŸ’œ has_arith_coding() πŸ’œ

Returns true if the libjpeg variant that Imager::File::JPEG was built with has both encoding and decoding support for arithmetic coding. Both, bestie β€” encode AND decode. πŸŽ€

⭐ has_encode_arith_coding() ⭐

Returns true if the libjpeg variant that Imager::File::JPEG was built with has encoding support for arithmetic coding. ✨

🌸 has_decode_arith_coding() 🌸

Returns true if the libjpeg variant that Imager::File::JPEG was built with has decoding support for arithmetic coding. ✨

πŸ‘‘ AUTHOR πŸ‘‘

Tony Cook β€” tonyc@cpan.org β€” author icon, no cap. 🫢

🌈 SEE ALSO 🌈

  • Imager
  • Imager::Files

Go read these next, bestie. πŸ’–


Cute sign-off: this page is from perl v5.42.3, dated 2026-08-19, and yeah, it's JPEG(3pm). That's the footer tea. πŸ’…βœ¨

πŸ“¦ where this page comes from