EBook::Ishmael::ImageID(3)

NAME
EBook::Ishmael::ImageID - Identify image data format

SYNOPSIS
  use EBook::Ishmael::ImageID;

  my $format = image_id($dataref);

DESCRIPTION
EBook::Ishmael::ImageID is a module that provides the "image_id()" subroutine, which identifies the image format of a given buffer. This is developer documentation, for ishmael user documentation you should consult its manual.

Currently, the following formats are supported:

jpg
png
gif
webp
bmp
tif
svg

SUBROUTINES

$f = image_id($dataref)
    Returns a string of the image format of the given image buffer. $dataref must be a scalar ref. Returns "undef" if the image's format could not be identified.

[$x, $y] = image_size($dataref, [$fmt])
    Returns an $x/$y pair representing the image data's size. $fmt is an optional argument specifying the format to use for the image data. If not specified, "image_size" will identify the format itself. If the image size could not be determined, returns "undef".

    This subroutine does not support the following formats (yet):

$bool = is_image_path($path)
    Returns true if $path looks like an image path name.

    webp
    tif

AUTHOR
Written by Samuel Young, <samyoung12788@gmail.com>.

This project's source can be found on its Codeberg Page <https://codeberg.org/1-1sam/ishmael>. Comments and pull requests are welcome!

COPYRIGHT
Copyright (C) 2025 Samuel Young

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.