WordPress.org

Make WordPress Core

Ticket #20408: testiptc.php

File testiptc.php, 245 bytes (added by koke, 2 years ago)

Test script: dump IPTC contents

Line 
1<?php
2
3$file = $argv[1];
4getimagesize( $file, $info );
5$iptc = iptcparse( $info['APP13'] );
6var_dump( $iptc );
7$title = $iptc['2#005'][0];
8printf( "Title: %s\n", trim( $title ) );
9printf( "Title(UTF8): %s\n", utf8_encode( trim( $title ) ) );
10
11?>