Giter VIP home page Giter VIP logo

image-jpeg-size's Introduction

NAME
    Image::JPEG::Size - find the size of JPEG images

SYNOPSIS
        use Image::JPEG::Size;

        my $jpeg_sizer = Image::JPEG::Size->new;
        my ($width, $height) = $jpeg_sizer->file_dimensions($filename);

DESCRIPTION
    This module uses libjpeg to rapidly determine the size of one or more
    JPEG images.

CONSTRUCTOR
    First create an instance of the class:

        my $jpeg_sizer = Image::JPEG::Size->new;

    The constructor initialises internal libjpeg structures; if that fails,
    an exception is thrown.

    The constructor takes attributes as either a hash reference or a
    listified hash. Unknown attributes are ignored. The following attributes
    are understood:

    "error"
        Specifies the action to take on encountering a non-recoverable error
        in an image; see "ERROR HANDLING". Defaults to "fatal".

    "warning"
        Specifies the action to take on encountering a recoverable error in
        an image; see "ERROR HANDLING". Defaults to "warn".

METHODS
  "file_dimensions"
    You can repeatedly call "file_dimensions" in list context to find the
    width and height of your JPEG images:

        my ($width, $height) = $jpeg_sizer->file_dimensions($filename);

    For now, the JPEG images must be supplied as a filename.

  "file_dimensions_hash"
    In some cases, you may prefer to get the image dimensions as a hash. The
    "file_dimensions_hash" takes a single filename argument, and returns a
    listified hash with keys "width" and "height".

ERROR HANDLING
    By default, recoverable errors in the image are reported using Perl's
    warning mechanism, and non-recoverable errors cause an exception to be
    thrown. However, this behaviour can be changed when creating an
    Image::JPEG::Size instance. The options are:

    "fatal"
        Throw an exception with information about the error, and stop
        processing this image immediately.

    "warn"
        Emit a Perl warning with information about the error. If the error
        is non-recoverable, image processing stops immediately, and its
        dimensions are reported as 0ร—0 pixels.

    "quiet"
        Suppress the error entirely. If the error is non-recoverable, image
        processing stops immediately, and its dimensions are reported as 0ร—0
        pixels.

AUTHOR
    Aaron Crane, <[email protected]>

    The initial development of this module was sponsored by Science Photo
    Library <https://www.sciencephoto.com/>.

COPYRIGHT
    Copyright 2017 Aaron Crane.

LICENSE
    This library is free software and may be distributed under the same
    terms as perl itself. See <http://dev.perl.org/licenses/>.

image-jpeg-size's People

Contributors

arc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.