<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#------------------------------------------------------------------------------
# File:         MNG.pm
#
# Description:  MNG and JNG meta information tags
#
# Revisions:    06/23/2005 - P. Harvey Created
#
# References:   1) http://www.libpng.org/pub/mng/
#------------------------------------------------------------------------------

package Image::ExifTool::MNG;

use strict;
use vars qw($VERSION);
use Image::ExifTool qw(:DataAccess :Utils);

$VERSION = '1.00';

# MNG chunks
%Image::ExifTool::MNG::Main = (
    GROUPS =&gt; { 2 =&gt; 'Image' },
    NOTES =&gt; q{
        This table contains definitions for tags found in MNG and JNG images.  MNG
        is a superset of PNG and JNG, so a MNG image may contain any of these tags
        as well as any PNG tags.  Conversely, only some of these tags are valid for
        JNG images.
    },
    BACK =&gt; {
        Name =&gt; 'Background',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::Background' },
    },
    BASI =&gt; {
        Name =&gt; 'BasisObject',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::BasisObject' },
    },
    CLIP =&gt; {
        Name =&gt; 'ClipObjects',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::ClipObjects' },
    },
    CLON =&gt; {
        Name =&gt; 'CloneObject',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::CloneObject' },
    },
    DBYK =&gt; {
        Name =&gt; 'DropByKeyword',
        Binary =&gt; 1,
    },
    DEFI =&gt; {
        Name =&gt; 'DefineObject',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::DefineObject' },
    },
    DHDR =&gt; {
        Name =&gt; 'DeltaPNGHeader',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::DeltaPNGHeader' },
    },
    DISC =&gt; {
        Name =&gt; 'DiscardObjects',
        ValueConv =&gt; 'join(" ",unpack("n*",$val))',
    },
    DROP =&gt; {
        Name =&gt; 'DropChunks',
        ValueConv =&gt; 'join(" ",$val=~/..../g)',
    },
#   ENDL
    eXPi =&gt; {
        Name =&gt; 'ExportImage',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::ExportImage' },
    },
    fPRI =&gt; {
        Name =&gt; 'FramePriority',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::FramePriority' },
    },
    FRAM =&gt; {
        Name =&gt; 'Frame',
        Binary =&gt; 1,
    },
#   IJNG
#   IPNG
#   JDAA (JNG)
#   JDAT (JNG)
    JHDR =&gt; { # (JNG)
        Name =&gt; 'JNGHeader',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::JNGHeader' },
    },
#   JSEP (JNG)
    LOOP =&gt; {
        Name =&gt; 'Loop',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::Loop' },
    },
    MAGN =&gt; {
        Name =&gt; 'MagnifyObject',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::MagnifyObject' },
    },
#   MEND
    MHDR =&gt; {
        Name =&gt; 'MNGHeader',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::MNGHeader' },
    },
    MOVE =&gt; {
        Name =&gt; 'MoveObjects',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::MoveObjects' },
    },
    nEED =&gt; {
        Name =&gt; 'ResourcesNeeded',
        Binary =&gt; 1,
    },
    ORDR =&gt; {
        Name =&gt; 'OrderingRestrictions',
        Binary =&gt; 1,
    },
    PAST =&gt; {
        Name =&gt; 'PasteImage',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::PasteImage' },
    },
    pHYg =&gt; {
        Name =&gt; 'GlobalPixelSize',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::PNG::PhysicalPixel' },
    },
    PPLT =&gt; {
        Name =&gt; 'PartialPalette',
        Binary =&gt; 1,
    },
    PROM =&gt; {
        Name =&gt; 'PromoteParent',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::PromoteParent' },
    },
    SAVE =&gt; {
        Name =&gt; 'SaveObjects',
        Binary =&gt; 1,
    },
    SEEK =&gt; {
        Name =&gt; 'SeekPoint',
        ValueConv =&gt; '$val=~s/\0.*//s; $val',
    },
    SHOW =&gt; {
        Name =&gt; 'ShowObjects',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::ShowObjects' },
    },
    TERM =&gt; {
        Name =&gt; 'TerminationAction',
        SubDirectory =&gt; { TagTable =&gt; 'Image::ExifTool::MNG::TerminationAction' },
    },
);

# MNG MHDR chunk
%Image::ExifTool::MNG::MNGHeader = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    FORMAT =&gt; 'int32u',
    0 =&gt; 'ImageWidth',
    1 =&gt; 'ImageHeight',
    2 =&gt; 'TicksPerSecond',
    3 =&gt; 'NominalLayerCount',
    4 =&gt; 'NominalFrameCount',
    5 =&gt; 'NominalPlayTime',
    6 =&gt; {
        Name =&gt; 'SimplicityProfile',
        PrintConv =&gt; 'sprintf("0x%.8x", $val)',
    },
);

# MNG BASI chunk
%Image::ExifTool::MNG::BasisObject = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'ImageWidth',
        Format =&gt; 'int32u',
    },
    4 =&gt; {
        Name =&gt; 'ImageHeight',
        Format =&gt; 'int32u',
    },
    8 =&gt; 'BitDepth',
    9 =&gt; {
        Name =&gt; 'ColorType',
        RawConv =&gt; '$Image::ExifTool::PNG::colorType = $val',
        PrintConv =&gt; {
            0 =&gt; 'Grayscale',
            2 =&gt; 'RGB',
            3 =&gt; 'Palette',
            4 =&gt; 'Grayscale with Alpha',
            6 =&gt; 'RGB with Alpha',
        },
    },
    10 =&gt; {
        Name =&gt; 'Compression',
        PrintConv =&gt; { 0 =&gt; 'Deflate/Inflate' },
    },
    11 =&gt; {
        Name =&gt; 'Filter',
        PrintConv =&gt; { 0 =&gt; 'Adaptive' },
    },
    12 =&gt; {
        Name =&gt; 'Interlace',
        PrintConv =&gt; { 0 =&gt; 'Noninterlaced', 1 =&gt; 'Adam7 Interlace' },
    },
    13 =&gt; {
        Name =&gt; 'RedSample',
        Format =&gt; 'int32u',
    },
    17 =&gt; {
        Name =&gt; 'GreenSample',
        Format =&gt; 'int32u',
    },
    21 =&gt; {
        Name =&gt; 'BlueSample',
        Format =&gt; 'int32u',
    },
    25 =&gt; {
        Name =&gt; 'AlphaSample',
        Format =&gt; 'int32u',
    },
    26 =&gt; 'Viewable',
);

# MNG LOOP chunk
%Image::ExifTool::MNG::Loop = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; 'NestLevel',
    1 =&gt; {
        Name =&gt; 'IterationCount',
        Format =&gt; 'int32u',
    },
    5 =&gt; {
        Name =&gt; 'TerminationCondition',
        PrintConv =&gt; {
            0 =&gt; 'Deterministic, not cacheable',
            1 =&gt; 'Decoder discretion, not cacheable',
            2 =&gt; 'User discretion, not cacheable',
            3 =&gt; 'External signal, not cacheable',
            4 =&gt; 'Deterministic, cacheable',
            5 =&gt; 'Decoder discretion, cacheable',
            6 =&gt; 'User discretion, cacheable',
            7 =&gt; 'External signal, cacheable',
        },
    },
    6 =&gt; {
        Name =&gt; 'IterationMinMax',
        Format =&gt; 'int32u[2]',
    },
    14 =&gt; {
        Name =&gt; 'SignalNumber',
        Format =&gt; 'int32u',
    },
);

# MNG DEFI chunk
%Image::ExifTool::MNG::DefineObject = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'ObjectID',
        Format =&gt; 'int16u',
    },
    2 =&gt; 'DoNotShow',
    3 =&gt; 'ConcreteFlag',
    4 =&gt; {
        Name =&gt; 'XYLocation',
        Format =&gt; 'int32u[2]',
    },
    12 =&gt; {
        Name =&gt; 'ClippingBoundary',
        Format =&gt; 'int32u[4]',
    },
);

# MNG CLON chunk
%Image::ExifTool::MNG::CloneObject = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'SourceID',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'CloneID',
        Format =&gt; 'int16u',
    },
    4 =&gt; {
        Name =&gt; 'CloneType',
        PrintConv =&gt; { 0 =&gt; 'Full', 1 =&gt; 'Parital', 2 =&gt; 'Renumber object' },
    },
    5 =&gt; 'DoNotShow',
    6 =&gt; 'ConcreteFlag',
    7 =&gt; {
        Name =&gt; 'LocalDeltaType',
        PrintConv =&gt; { 0 =&gt; 'Absolute', 1 =&gt; 'Relative' },
    },
    8 =&gt; {
        Name =&gt; 'DeltaXY',
        Format =&gt; 'int32u[2]',
    },
);

# MNG PAST chunk
%Image::ExifTool::MNG::PasteImage = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'DestinationID',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'TargetDeltaType',
        PrintConv =&gt; { 0 =&gt; 'Absolute', 1 =&gt; 'Relative' },
    },
    3 =&gt; {
        Name =&gt; 'TargetXY',
        Format =&gt; 'int32u[2]',
    },
    11 =&gt; {
        Name =&gt; 'SourceID',
        Format =&gt; 'int16u',
    },
    13 =&gt; {
        Name =&gt; 'CompositionMode',
        PrintConv =&gt; { 0 =&gt; 'Over', 1 =&gt; 'Replace', 2 =&gt; 'Under' },
    },
    14 =&gt; {
        Name =&gt; 'Orientation',
        PrintConv =&gt; {
            0 =&gt; 'Same as source',
            2 =&gt; 'Flipped left-right, then up-down',
            4 =&gt; 'Flipped left-right',
            6 =&gt; 'Flipped up-down',
            8 =&gt; 'Tiled',
        },
    },
    15 =&gt; {
        Name =&gt; 'OffsetOrigin',
        PrintConv =&gt; { 0 =&gt; 'Desination Origin', 1 =&gt; 'Target Origin' },
    },
    16 =&gt; {
        Name =&gt; 'OffsetXY',
        Format =&gt; 'int32u[2]',
    },
    24 =&gt; {
        Name =&gt; 'BoundaryOrigin',
        PrintConv =&gt; { 0 =&gt; 'Desination Origin', 1 =&gt; 'Target Origin' },
    },
    25 =&gt; {
        Name =&gt; 'PastClippingBoundary',
        Format =&gt; 'int32u[4]',
    },
);

my %magMethod = (
    0 =&gt; 'No Magnification',
    1 =&gt; 'Pixel Replication',
    2 =&gt; 'Linear Interpolation',
    3 =&gt; 'Closest Pixel',
    4 =&gt; 'Color Linear Interpolation and Alpha Closest Pixel',
    5 =&gt; 'Color Closest Pixel and Alpha Linear Interpolation',
);

# MNG MAGN chunk
%Image::ExifTool::MNG::MagnifyObject = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'FirstObjectID',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'LastObjectID',
        Format =&gt; 'int16u',
    },
    4 =&gt; {
        Name =&gt; 'XMethod',
        PrintConv =&gt; \%magMethod,
    },
    5 =&gt; {
        Name =&gt; 'XMag',
        Format =&gt; 'int16u',
    },
    7 =&gt; {
        Name =&gt; 'YMag',
        Format =&gt; 'int16u',
    },
    9 =&gt; {
        Name =&gt; 'LeftMag',
        Format =&gt; 'int16u',
    },
    11 =&gt; {
        Name =&gt; 'RightMag',
        Format =&gt; 'int16u',
    },
    13 =&gt; {
        Name =&gt; 'TopMag',
        Format =&gt; 'int16u',
    },
    15 =&gt; {
        Name =&gt; 'BottomMag',
        Format =&gt; 'int16u',
    },
    17 =&gt; {
        Name =&gt; 'YMethod',
        PrintConv =&gt; \%magMethod,
    },
);

# MNG TERM chunk
%Image::ExifTool::MNG::TerminationAction = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'TerminationAction',
        PrintConv =&gt; {
            0 =&gt; 'Show Last Frame',
            1 =&gt; 'Display Nothing',
            2 =&gt; 'Show First Frame',
            3 =&gt; 'Repeat Sequence',
        },
    },
    1 =&gt; {
        Name =&gt; 'IterationEndAction',
        PrintConv =&gt; {
            0 =&gt; 'Show Last Frame',
            1 =&gt; 'Display Nothing',
            2 =&gt; 'Show First Frame',
        },
    },
    2 =&gt; {
        Name =&gt; 'Delay',
        Format =&gt; 'int32u',
    },
    6 =&gt; {
        Name =&gt; 'IterationMax',
        Format =&gt; 'int32u',
    },
);

# MNG BACK chunk
%Image::ExifTool::MNG::Background = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'BackgroundColor',
        Format =&gt; 'int16u[3]',
    },
    6 =&gt; {
        Name =&gt; 'MandatoryBackground',
        PrintConv =&gt; {
            0 =&gt; 'Color and Image Advisory',
            1 =&gt; 'Color Mandatory, Image Advisory',
            2 =&gt; 'Color Advisory, Image Mandatory',
            3 =&gt; 'Color and Image Mandatory',
        },
    },
    7 =&gt; {
        Name =&gt; 'BackgroundImageID',
        Format =&gt; 'int16u',
    },
    9 =&gt; {
        Name =&gt; 'BackgroundTiling',
        PrintConv =&gt; { 0 =&gt; 'No', 1 =&gt; 'Yes' },
    },
);

# MNG MOVE chunk
%Image::ExifTool::MNG::MoveObjects = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'FirstObject',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'LastObject',
        Format =&gt; 'int16u',
    },
    4 =&gt; {
        Name =&gt; 'DeltaType',
        PrintConv =&gt; { 0 =&gt; 'Absolute', 1 =&gt; 'Relative' },
    },
    5 =&gt; {
        Name =&gt; 'DeltaXY',
        Format =&gt; 'int32u[2]',
    },
);

# MNG CLIP chunk
%Image::ExifTool::MNG::ClipObjects = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'FirstObject',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'LastObject',
        Format =&gt; 'int16u',
    },
    4 =&gt; {
        Name =&gt; 'DeltaType',
        PrintConv =&gt; { 0 =&gt; 'Absolute', 1 =&gt; 'Relative' },
    },
    5 =&gt; {
        Name =&gt; 'ClipBoundary',
        Format =&gt; 'int32u[4]',
    },
);

# MNG SHOW chunk
%Image::ExifTool::MNG::ShowObjects = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'FirstObject',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'LastObject',
        Format =&gt; 'int16u',
    },
    4 =&gt; 'ShowMode',
);

# MNG eXPI chunk
%Image::ExifTool::MNG::ExportImage = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'SnapshotID',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'SnapshotName',
        Format =&gt; 'string',
    },
);

# MNG fPRI chunk
%Image::ExifTool::MNG::FramePriority = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'DeltaType',
        PrintConv =&gt; { 0 =&gt; 'Absolute', 1 =&gt; 'Relative' },
    },
    2 =&gt; 'Priority',
);

# MNG DHDR chunk
%Image::ExifTool::MNG::DeltaPNGHeader = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'ObjectID',
        Format =&gt; 'int16u',
    },
    2 =&gt; {
        Name =&gt; 'ImageType',
        PrintConv =&gt; {
            0 =&gt; 'Unspecified',
            1 =&gt; 'PNG',
            2 =&gt; 'JNG',
        },
    },
    3 =&gt; {
        Name =&gt; 'DeltaType',
        PrintConv =&gt; {
            0 =&gt; 'Full Replacement',
            1 =&gt; 'Pixel Addition',
            2 =&gt; 'Alpha Addition',
            3 =&gt; 'Color Addition',
            4 =&gt; 'Pixel Replacement',
            5 =&gt; 'Alpha Replacement',
            6 =&gt; 'Color Replacement',
            7 =&gt; 'No Change',
        },
    },
    4 =&gt; {
        Name =&gt; 'BlockSize',
        Format =&gt; 'int32u[2]',
    },
    12 =&gt; {
        Name =&gt; 'BlockLocation',
        Format =&gt; 'int32u[2]',
    },
);

# MNG PROM chunk
%Image::ExifTool::MNG::PromoteParent = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; 'NewColorType',
    1 =&gt; 'NewBitDepth',
    2 =&gt; {
        Name =&gt; 'FillMethod',
        PrintConv =&gt; { 0 =&gt; 'Bit Replication', 1 =&gt; 'Zero Fill' },
    },
);

# JNG JHDR chunk
%Image::ExifTool::MNG::JNGHeader = (
    PROCESS_PROC =&gt; \&amp;Image::ExifTool::ProcessBinaryData,
    GROUPS =&gt; { 2 =&gt; 'Image' },
    0 =&gt; {
        Name =&gt; 'ImageWidth',
        Format =&gt; 'int32u',
    },
    4 =&gt; {
        Name =&gt; 'ImageHeight',
        Format =&gt; 'int32u',
    },
    8 =&gt; {
        Name =&gt; 'ColorType',
        PrintConv =&gt; {
            8 =&gt; 'Gray',
            10 =&gt; 'Color',
            12 =&gt; 'Gray Alpha',
            14 =&gt; 'Color Alpha',
        },
    },
    9 =&gt; 'BitDepth',
    10 =&gt; {
        Name =&gt; 'Compression',
        PrintConv =&gt; { 8 =&gt; 'Huffman-coded baseline JPEG' },
    },
    11 =&gt; {
        Name =&gt; 'Interlace',
        PrintConv =&gt; { 0 =&gt; 'Sequential', 8 =&gt; 'Progressive' },
    },
    12 =&gt; 'AlphaBitDepth',
    13 =&gt; {
        Name =&gt; 'AlphaCompression',
        PrintConv =&gt; {
            0 =&gt; 'MNG Grayscale IDAT',
            8 =&gt; 'JNG 8-bit Grayscale JDAA',
        },
    },
    14 =&gt; {
        Name =&gt; 'AlphaFilter',
        PrintConv =&gt; { 0 =&gt; 'Adaptive MNG (N/A for JPEG)' },
    },
    15 =&gt; {
        Name =&gt; 'AlphaInterlace',
        PrintConv =&gt; { 0 =&gt; 'Noninterlaced' },
    },
);

1;  # end

__END__

=head1 NAME

Image::ExifTool::MNG - MNG and JNG meta information tags

=head1 SYNOPSIS

This module is used by Image::ExifTool

=head1 DESCRIPTION

This module contains definitions required by Image::ExifTool to read MNG
(Multi-image Network Graphics) and JNG (JPEG Network Graphics) images.

=head1 AUTHOR

Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=head1 REFERENCES

=over 4

=item L&lt;http://www.libpng.org/pub/mng/&gt;

=back

=head1 SEE ALSO

L&lt;Image::ExifTool::TagNames/MNG Tags&gt;,
L&lt;Image::ExifTool::TagNames/PNG Tags&gt;,
L&lt;Image::ExifTool(3pm)|Image::ExifTool&gt;

=cut

</pre></body></html>