iptcparse

Parse a binary IPTC block into single tags

Syntax

iptcparse(
    string $iptc_block
): array|false

Parameters

iptc_block

A binary IPTC block.

Return

Returns an array using the tagmarker as an index and the value as the value. It returns false on error or if no IPTC data was found.

Examples

1 · return

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/jpg/2.jpg';
getimagesize($filename, $image_info);

$iptc_block = $image_info['APP13'];

$return = iptcparse($iptc_block);

print_r($return);

?>
Array
(
    [2#005] => Array
        (
            [0] => DocumentTitle
        )

    [2#010] => Array
        (
            [0] => Urgency
        )

    [2#015] => Array
        (
            [0] => Category
        )

    [2#020] => Array
        (
            [0] => Subcatagories
        )

    [2#040] => Array
        (
            [0] => SpecialInstructions
        )

    [2#055] => Array
        (
            [0] => CreationDate
        )

    [2#080] => Array
        (
            [0] => AuthorByline
        )

    [2#085] => Array
        (
            [0] => AuthorTitle
        )

    [2#090] => Array
        (
            [0] => City
        )

    [2#095] => Array
        (
            [0] => State
        )

    [2#101] => Array
        (
            [0] => Country
        )

    [2#103] => Array
        (
            [0] => OTR
        )

    [2#105] => Array
        (
            [0] => Headline
        )

    [2#110] => Array
        (
            [0] => Source
        )

    [2#115] => Array
        (
            [0] => PhotoSource
        )

    [2#116] => Array
        (
            [0] => Copyright
        )

    [2#120] => Array
        (
            [0] => Caption
        )

    [2#122] => Array
        (
            [0] => CaptionWriter
        )

)

gd_info

getimagesize

getimagesizefromstring

image_type_to_extension

image_type_to_mime_type

imageaffine

imageaffinematrixconcat

imageaffinematrixget

imagealphablending

imageantialias

imagearc

imageavif

imagebmp

imagechar

imagecharup

imagecolorallocate

imagecolorallocatealpha

imagecolorat

imagecolorclosest

imagecolorclosestalpha

imagecolorclosesthwb

imagecolordeallocate

imagecolorexact

imagecolorexactalpha

imagecolormatch

imagecolorresolve

imagecolorresolvealpha

imagecolorset

imagecolorsforindex

imagecolorstotal

imagecolortransparent

imageconvolution

imagecopy

imagecopymerge

imagecopymergegray

imagecopyresampled

imagecopyresized

imagecreate

imagecreatefromavif

imagecreatefrombmp

imagecreatefromgif

imagecreatefromjpeg

imagecreatefrompng

imagecreatefromstring

imagecreatefromtga

imagecreatefromwbmp

imagecreatefromwebp

imagecreatefromxbm

imagecreatefromxpm

imagecreatetruecolor

imagecrop

imagecropauto

imagedashedline

imagedestroy

imageellipse

imagefill

imagefilledarc

imagefilledellipse

imagefilledpolygon

imagefilledrectangle

imagefilltoborder

imagefilter

imageflip

imagefontheight

imagefontwidth

imageftbbox

imagefttext

imagegammacorrect

imagegetclip

imagegetinterpolation

imagegif

imageinterlace

imageistruecolor

imagejpeg

imagelayereffect

imageline

imageloadfont

imageopenpolygon

imagepalettecopy

imagepalettetotruecolor

imagepng

imagepolygon

imagerectangle

imageresolution

imagerotate

imagesavealpha

imagescale

imagesetbrush

imagesetclip

imagesetinterpolation

imagesetpixel

imagesetstyle

imagesetthickness

imagesettile

imagestring

imagestringup

imagesx

imagesy

imagetruecolortopalette

imagettfbbox

imagettftext

imagetypes

imagewbmp

imagewebp

imagexbm

iptcembed

HomeMenu