Get iptc metadata of jpg image in php

php get file metadata
php get image date
php exif metadata
read image data in php
php image data
php iptc read
php edit image metadata
exif_read_data(): unable to open file

I'm trying to get some iptc metadata from jpg image (http://pepeliana.com/images/DSC4008.jpg) with php. The Title metadata of the referenced image is set to "Testing". I've went through the php manual and both functions that seemed to do the job - iptcparse() and exif_read_data(). Both functions are enabled in php. However for the life of me, I can't figure out, why both functions do not return the desired data. Here is a sample code I've tried and I should also mention that I've also tried this code on several images that have Title iptc metadata (thus excluding the possibility of a corrupted image or improperly set metadata):

<?php 
$size = getimagesize ('DSC4008.jpg', $info);       
 if(is_array($info)) {   
    $iptc = iptcparse($info["APP13"]);
    foreach (array_keys($iptc) as $s) {             
        $c = count ($iptc[$s]);
        for ($i=0; $i <$c; $i++)
        {
            echo $s.' = '.$iptc[$s][$i].'<br>';
        }
    }                 
}
 ?>

also:

<?php
$exif = exif_read_data('DSC4008.jpg', 0, true);
echo $exif['WINXP']['Title'];
?>

As you can see, this is as simple as it gets, yet, I cannot get either to return what I want. Clearly I must be missing something obviously simple, no? Please help!


You have set the ImageDescription of your image to "Testing" This here will work:

$exif = exif_read_data('1.jpg','IFD0',true);
echo $exif["IFD0"]["ImageDescription"];

echoes

Testing

iptcparse - Manual, iptcparse — Parse a binary IPTC block into single tags I have written a library "​PHP JPEG Metadata Toolkit" which fixes this problem as it allows reading,  User Contributed Notes 17 notes. The following code embeds both IPTC APP segment 13 and EXIF APP segment 1 data from a source file and embeds it into a destination file. This overcomes the limitation where the iptcembed statement does not seem to embed EXIF data, only IPTC data. // JPEG file has format 0xFFD8 + [APP0] + [APP1] +


Try this:

$size = getimagesize( 'DSC4008.jpg', $iptch );

$iptc = isset( $iptch['APP13'] ) ? iptcparse( $iptch['APP13'] ) : false;
$name = isset( $iptc['2#005'] ) ? $iptc['2#005'][0] : 'Undefined';

iptcembed - Manual, iptcembed — Embeds binary IPTC data into a JPEG image Function transfers EXIF (APP1) and IPTC (APP13) from $srcfile and adds it to $destfile // JPEG file has This one also is included when getting IPTC info using iptcparse(). So my  You might have noticed that several metadata fields in Photoshop are not available via IPTC. I have written a library "PHP JPEG Metadata Toolkit" which fixes this problem as it allows reading, writing and interpreting of virtually any type of metadata, including these missing fields.


I had similar issues and created my own library for that

First — you'll need to install it with Composer

composer require ibudasov/php7-iptc-manager

Then

// import the Manager class
use iBudasov\Iptc\Manager;

// ... and instantiate it!
$manager = Manager::create();

$manager->loadFile('./DSC4008.jpg');

$title = $manager->getTag(Tag::OBJECT_NAME);

How to get metadata information in images - PHP, But i dont want IPTC or Exif details. Plase find the attached screenshots for your reference. <?php $picinfo = array(); getimagesize('upload/files/181751756.jpg',  PHP image metadata library (XMP, IPTC, Exif). Contribute to dchesterton/image development by creating an account on GitHub.


The PHP JPEG Metadata Toolkit, Included with the PHP JPEG Metadata Toolkit is an example script, which shows how the library can be used to retrieve metadata from a JPEG image file. This is Photoshop_IRB.php, For accessing Photoshop IRB & IPTC-NAA IIM segments. exif_read_data() reads the EXIF headers from an image file. This way you can read meta data generated by digital cameras. EXIF headers tend to be present in JPEG/TIFF images generated by digital cameras, but unfortunately each digital camera maker has a different idea of how to actually tag their images, so you can't always rely on a specific Exif header being present.


image-metadata-cruncher/image-metadata-cruncher.php at , <?php. /*. Plugin Name: Image Metadata Cruncher. Description: Gives you ultimate the EXIF and IPTC mapping arrays are quite long, so they deserve to be in separate files Try to get template from $template array then from $options. width="589" height="632", 632, 589, 1, 0, f/2.8, 4294967296.00m, 2, image/​jpeg. A key element of this service is ExifTool, a software developed by Phil Harvey, to retrieve a rich set of metadata fields in different technical formats or to embed such a set into image and video files. The Get-IPTC-Metadata open source project is available at Michael Steidl's Github repository.


Get iptc metadata of jpg image in php, I'm trying to get some iptc metadata from jpg image (http://pepeliana.com/images/​DSC4008.jpg) with php. The Title metadata of the referenced image is set to  PIL - How do I resize an image while keeping the IPTC and EXIF info? EXIF Properties, .Net and Digital Image Library; can DotNet read and/or write exif; C# Lib to read/write Exif and IPTC ?? Get EXIF data from picture; Javascript to Access JPEG Metadata XMP, IPTC, EXIF; Saving Jpeg/Exif info Please Help. Metadata EXIF