CINXE.COM

January | 2010 | code.flickr.com

<!DOCTYPE html> <!--[if IE 6]> <html id="ie6" lang="en"> <![endif]--> <!--[if IE 7]> <html id="ie7" lang="en"> <![endif]--> <!--[if IE 8]> <html id="ie8" lang="en"> <![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--> <html lang="en"> <!--<![endif]--> <!-- generated in 0.229 seconds 36020 bytes batcached for 300 seconds --> <head><script type="text/javascript" src="https://web-static.archive.org/_static/js/bundle-playback.js?v=7YQSqjSh" charset="utf-8"></script> <script type="text/javascript" src="https://web-static.archive.org/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="https://web-static.archive.org/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://code.flickr.net:80/2010/01/","20130503115014","https://web.archive.org/","web","https://web-static.archive.org/_static/", "1367581814"); </script> <link rel="stylesheet" type="text/css" href="https://web-static.archive.org/_static/css/banner-styles.css?v=p7PEIJWi" /> <link rel="stylesheet" type="text/css" href="https://web-static.archive.org/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width"/> <title>January | 2010 | code.flickr.com</title> <link rel="profile" href="http://gmpg.org/xfn/11"/> <link rel="stylesheet" type="text/css" media="all" href="https://web.archive.org/web/20130503115014cs_/http://s2.wp.com/wp-content/themes/vip/flickr-code/style.css?m=1345671377g"/> <link rel="pingback" href="http://code.flickr.net/xmlrpc.php"/> <!--[if lt IE 9]> <script src="http://s2.wp.com/wp-content/themes/pub/twentyeleven/js/html5.js?m=1354160568g" type="text/javascript"></script> <![endif]--> <script src="https://web.archive.org/web/20130503115014js_/http://r-login.wordpress.com/remote-login.php?action=js&amp;host=code.flickr.net&amp;id=39034126&amp;t=1367581814&amp;back=code.flickr.net%2F2010%2F01%2F" type="text/javascript"></script> <script type="text/javascript"> /* <![CDATA[ */ if ( 'function' === typeof WPRemoteLogin ) { document.cookie = "wordpress_test_cookie=test; path=/"; if ( document.cookie.match( /(;|^)\s*wordpress_test_cookie\=/ ) ) { WPRemoteLogin(); } } /* ]]> */ </script> <link rel="alternate" type="application/rss+xml" title="code.flickr.com » Feed" href="https://web.archive.org/web/20130503115014/http://code.flickr.net/feed/"/> <link rel="alternate" type="application/rss+xml" title="code.flickr.com » Comments Feed" href="https://web.archive.org/web/20130503115014/http://code.flickr.net/comments/feed/"/> <script type="text/javascript"> /* <![CDATA[ */ function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}} /* ]]> */ </script> <link rel="stylesheet" id="all-css-0" href="https://web.archive.org/web/20130503115014cs_/http://s1.wp.com/_static/??-eJydjkkOwjAMRS9EsJhadYE4SxrcJI2TWI3bqrenILFiEGJlff+nZ8PMyuQkmATiqJhG61MB8gEL9CisTVCPtDWlbOA9zrmI6kj7AYoshC+sOIyrkMcWZF4XCxJOmL7Tk2foyJswrM0V/1GrmU2Ov77u9OCTfc5Pl9wRLOVW0x24xPPuUNX7qm6aU38DFuV8+Q==" type="text/css" media="all"/> <script type="text/javascript" src="https://web.archive.org/web/20130503115014js_/http://s1.wp.com/_static/??-eJyFzUEKgCAQBdALZSKRu+gsYkOMpZkzFXX6CmoRRMHAX/zHH7lEgcH2UwMk3XHjBGm9IneUyS8gPLbJMNzQDoEh8OniQOyByLRv7fMNhhlh+WUOOBrbiQSE27la+0oVWpeqULp0O6cpS2E="></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://flickrcode.wordpress.com/xmlrpc.php?rsd"/> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://flickrcode.wordpress.com/wp-includes/wlwmanifest.xml"/> <meta name="generator" content="WordPress.com"/> <link rel="shortcut icon" type="image/x-icon" href="https://web.archive.org/web/20130503115014im_/http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16" sizes="16x16"/> <link rel="icon" type="image/x-icon" href="https://web.archive.org/web/20130503115014im_/http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16" sizes="16x16"/> <link rel="apple-touch-icon-precomposed" href="https://web.archive.org/web/20130503115014im_/http://0.gravatar.com/blavatar/8b1d73fba9c0d02a3e78929d8cecfd82?s=114"/> <link rel="openid.server" href="http://flickrcode.wordpress.com/?openidserver=1"/> <link rel="openid.delegate" href="http://flickrcode.wordpress.com/"/> <link rel="search" type="application/opensearchdescription+xml" href="https://web.archive.org/web/20130503115014/http://code.flickr.net/osd.xml" title="code.flickr.com"/> <link rel="search" type="application/opensearchdescription+xml" href="https://web.archive.org/web/20130503115014/http://wordpress.com/opensearch.xml" title="WordPress.com"/> <style> /* <![CDATA[ */ /* Block: reblog */ .reblog-from img { margin: 0 10px 0 0; vertical-align: middle; padding: 0; border: 0; } .reblogger-note img.avatar { float: left; padding: 0; border: 0; } .reblogger-note-content { margin: 0 0 20px; } .reblog-post .wpcom-enhanced-excerpt-content { border-left: 3px solid #eee; padding-left: 15px; } .reblog-post ul.thumb-list { display: block; list-style: none; margin: 2px 0; padding: 0; clear: both; } .reblog-post ul.thumb-list li { display: inline; margin: 0; padding: 0 1px; border: 0; } .reblog-post ul.thumb-list li a { margin: 0; padding: 0; border: 0; } .reblog-post ul.thumb-list li img { margin: 0; padding: 0; border: 0; } .reblog-post .wpcom-enhanced-excerpt { clear: both; } .reblog-post .wpcom-enhanced-excerpt address, .reblog-post .wpcom-enhanced-excerpt li, .reblog-post .wpcom-enhanced-excerpt h1, .reblog-post .wpcom-enhanced-excerpt h2, .reblog-post .wpcom-enhanced-excerpt h3, .reblog-post .wpcom-enhanced-excerpt h4, .reblog-post .wpcom-enhanced-excerpt h5, .reblog-post .wpcom-enhanced-excerpt h6, .reblog-post .wpcom-enhanced-excerpt p { font-size: 100% !important; } .reblog-post .wpcom-enhanced-excerpt blockquote, .reblog-post .wpcom-enhanced-excerpt pre, .reblog-post .wpcom-enhanced-excerpt code, .reblog-post .wpcom-enhanced-excerpt q { font-size: 98% !important; } /* ]]> */ </style> <meta name="application-name" content="code.flickr.com"/><meta name="msapplication-window" content="width=device-width;height=device-height"/><meta name="msapplication-task" content="name=Subscribe;action-uri=http://code.flickr.net/feed/;icon-uri=http://1.gravatar.com/blavatar/341946154e8a7e5497473810e7ef560c?s=16"/> <style type="text/css" id="twentyeleven-header-css"> #site-title, #site-description { position: absolute !important; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); } </style> <style id="syntaxhighlighteranchor"></style> <link rel="stylesheet" id="custom-css-css" type="text/css" href="https://web.archive.org/web/20130503115014cs_/http://s1.wp.com/?custom-css=1&amp;csblog=2DMyG&amp;cscache=6&amp;csrev=103"/> </head> <body class="archive date typekit-enabled two-column right-sidebar highlander-enabled highlander-light"> <div id="page" class="hfeed"> <header id="branding" role="banner"> <hgroup> <h1 id="site-title"><span><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/" title="code.flickr.com" rel="home">code.flickr.com</a></span></h1> <h2 id="site-description"></h2> </hgroup> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/"> <img src="https://web.archive.org/web/20130503115014im_/http://flickrcode.files.wordpress.com/2012/09/code-flickr-com-drawn-header-grey-large.png" width="1000" height="157" alt=""/> </a> <div class="only-search with-image"> <form method="get" id="searchform" action="https://web.archive.org/web/20130503115014/http://code.flickr.net/"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" id="s" placeholder="Search"/> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"/> </form> </div> <nav id="access" role="navigation"> <h3 class="assistive-text">Main menu</h3> <div class="skip-link"><a class="assistive-text" href="#content" title="Skip to primary content">Skip to primary content</a></div> <div class="skip-link"><a class="assistive-text" href="#secondary" title="Skip to secondary content">Skip to secondary content</a></div> <div class="menu-menu-container"><ul id="menu-menu" class="menu"><li id="menu-item-2084" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2084"><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/">Flickr</a></li> <li id="menu-item-2085" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2085"><a href="https://web.archive.org/web/20130503115014/http://blog.flickr.net/">Flickr Blog</a></li> <li id="menu-item-2250" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2250"><a href="https://web.archive.org/web/20130503115014/http://twitter.com/flickr">@flickr</a></li> <li id="menu-item-2086" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2086"><a href="https://web.archive.org/web/20130503115014/http://twitter.com/flickrapi">@flickrapi</a></li> <li id="menu-item-2087" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2087"><a href="https://web.archive.org/web/20130503115014/http://developer.flickr.com/">Developer Guidelines</a></li> <li id="menu-item-2088" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2088"><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/">API</a></li> <li id="menu-item-2089" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2089"><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/jobs/">Jobs</a></li> </ul></div> </nav><!-- #access --> </header><!-- #branding --> <div id="main"> <section id="primary"> <div id="content" role="main"> <header class="page-header"> <h1 class="page-title"> Monthly Archives: <span>January 2010</span> </h1> </header> <article id="post-1280" class="post-1280 post type-post status-publish format-standard hentry category-uncategorized"> <header class="entry-header"> <h1 class="entry-title"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/01/21/people-in-photos-the-api-methods/" rel="bookmark">People in Photos: The API&nbsp;Methods</a></h1> <div class="entry-meta"> <span class="sep">Posted on </span><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/01/21/people-in-photos-the-api-methods/" title="7:44 pm" rel="bookmark"><time class="entry-date" datetime="2010-01-21T19:44:38+00:00">January 21, 2010</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="https://web.archive.org/web/20130503115014/http://code.flickr.net/author/flickrphotography/" title="View all posts by Simon Batistoni" rel="author">Simon Batistoni</a></span></span> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <p>I&#8217;ve been racking my brains for a while trying to think of something informative to tell you about the API methods we&#8217;re releasing today, but all I keep coming back to is a venerable British advertising slogan for a brand of woodstain: &#8220;<a href="https://web.archive.org/web/20130503115014/http://en.wikipedia.org/wiki/Does_exactly_what_it_says_on_the_tin">It does exactly what it says on the tin</a>&#8220;.</p> <h2>What does the tin say, then?</h2> <div style="margin-top:30px;margin-bottom:30px;"><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/5500/2268674/"><img style="border:1px dotted #ccc;padding:10px;" src="https://web.archive.org/web/20130503115014im_/http://farm1.static.flickr.com/1/2268674_a8859cec2c.jpg" alt="" width="352" height="500"/></a></p> <div style="font-size:small;text-align:right;">photo by <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/5500/">5500</a></div> </div> <p>First off, we have a simple accessor method which will return you a list of people for a given photo. It&#8217;s called <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.photos.people.getList.html">flickr.photos.people.getList</a>, and it takes a photo ID as its sole argument.</p> <p>But what about the reverse &#8211; finding all the photos of a given person? Fret not, that&#8217;s why we have <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.people.getPhotosOf.html">flickr.people.getPhotosOf</a>. This method takes a user ID, and since it returns a <a href="https://web.archive.org/web/20130503115014/http://code.flickr.com/blog/2008/08/19/standard-photos-response-apis-for-civilized-age/">Standard Photos Response</a>, you can also specify any extra data you want through the <code>extras</code> parameter.</p> <p>Sometimes, simply consuming data isn&#8217;t enough &#8211; you will feel a need to create some. If you want to add a person to a photo, simply use <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.photos.people.add.html">flickr.photos.people.add</a>. This method takes a photo_id and a user_id, and can optionally take another 4 arguments (<code>person_x</code>, <code>person_y</code>, <code>person_w</code>, <code>person_h</code>) to specify a &#8220;face boundary&#8221; for that person.</p> <p>If you decide you don&#8217;t like the face boundary later, there&#8217;s always <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.photos.people.deleteCoords.html">flickr.photos.people.deleteCoords</a> to remove it entirely, or <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.photos.people.editCoords.html">flickr.photos.people.editCoords</a> to update.</p> <p>Last, but not least, you can remove someone from a photo with <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/api/flickr.photos.people.delete.html">flickr.photos.people.delete</a>.</p> <p>Obviously, all of the above methods require that the calling user is permitted to perform the action in question.</p> <h2>Why so late?</h2> <p>We&#8217;re aware that some people have been clamoring for access to these methods for a little while now. And while I&#8217;m not generally one for making excuses, I do have a pretty good reason for the delay this time &#8211; I broke my leg snowboarding a month ago.</p> <p>What&#8217;s more, I have evidence, in the form of a photo which I marked as containing me, using the Flickr API&#8230;</p> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/hitherto/4276421163/" title="Loaded onto the sledge by hitherto, on Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm5.static.flickr.com/4056/4276421163_2804b53e95.jpg" width="375" height="500" alt="Loaded onto the sledge"/></a></p> <p>So, yeah, sorry about that. </p> <div id="jp-post-flair" class="sharedaddy sd-like-enabled sd-sharing-enabled"></div> </div><!-- .entry-content --> <footer class="entry-meta"> <span class="cat-links"> <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a> </span> </footer><!-- .entry-meta --> </article><!-- #post-1280 --> <article id="post-1239" class="post-1239 post type-post status-publish format-standard hentry category-uploadr tag-characterset tag-encoding tag-exif tag-i18n tag-international"> <header class="entry-header"> <h1 class="entry-title"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/01/08/a-chinese-puzzle-unicode-and-exif-metadata-parsing/" rel="bookmark">A Chinese puzzle: Unicode and EXIF metadata&nbsp;parsing</a></h1> <div class="entry-meta"> <span class="sep">Posted on </span><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/01/08/a-chinese-puzzle-unicode-and-exif-metadata-parsing/" title="5:09 pm" rel="bookmark"><time class="entry-date" datetime="2010-01-08T17:09:50+00:00">January 8, 2010</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="https://web.archive.org/web/20130503115014/http://code.flickr.net/author/flickrphotography/" title="View all posts by Jerome Decq" rel="author">Jerome Decq</a></span></span> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="entry-content"> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/groume/4213420959/" title="Le Presque-Cube de Groume, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm5.static.flickr.com/4006/4213420959_a8c7d0959e.jpg" width="500" height="375" alt="Le Presque-Cube"/></a></p> <p>At flickr, there are <a href="https://web.archive.org/web/20130503115014/http://blog.flickr.net/en/2009/10/12/4000000000/"> quite a few photos</a> and you can browse the site in 8 different languages, including Korean and Chinese. Common metadata such as title, description and tags can be pre-populated based on information contained in the image itself, using what is commonly called EXIF information. So, it makes sense to implement this with respect to language and, above all, alphabet/character encodings.  </p> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/tchi-tcha/2696672129/" title="Un peu de lecture...? de Raïssa Bandou, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm4.static.flickr.com/3206/2696672129_1639190db2.jpg" width="500" height="375" alt="Un peu de lecture...?"/></a></p> <p>Well, what made sense did not make so much sense anymore when using existing specifications. Here is how we coped with them.</p> <h2>The standards</h2> <p> To begin with, there is not just EXIF. Metadata can actually be written within a picture file in at least 3 different formats:<br/> - <a href="https://web.archive.org/web/20130503115014/http://en.wikipedia.org/wiki/EXIF">EXIF</a> itself.<br/> - <a href="https://web.archive.org/web/20130503115014/http://en.wikipedia.org/wiki/IPTC_Information_Interchange_Model">IPTC-IIM</a> headers.<br/> - <a href="https://web.archive.org/web/20130503115014/http://en.wikipedia.org/wiki/Extensible_Metadata_Platform">XMP</a> by Adobe.</p> <p>Of course, these formats are neither mutually exclusive nor completely redundant and this is where this can get tricky.</p> <p>But let’s step back a moment to describe the specifics of these formats, not in details, but with regards to our need, which is to extract information in a reliable way, independently from how/when/where the image was created.</p> <h3>The EXIF is the oldest form</h3> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/mcgraths/2431583107/" title="Old Cars Part 1 de seanmcgrath, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm4.static.flickr.com/3149/2431583107_aec3e2889e.jpg" width="500" height="334" alt="Old Cars Part 1"/></a><br/> Hence, with the most limitations yet the most widespread, as this is often the case in our industry. Thus, we need to deal with it, even though it is radically flawed from an internationalization stand point: text fields are not stored using UTF and most of the time there is no indication of the character set encoding.</p> <h3> IPTC-IIM</h3> <p>In its later versions, it added the optional (Grr!!!) support for a field indicating the encoding of all the string properties in the container.</p> <h3>XMP</h3> <p>At last, text from XMP format is stored in UTF-8. On a side note, the XML based openness of this format is not making things easier, for each application can come up with its own set of metadata. Nevertheless, from an internationalization and structural standpoint, this format is modernly adequate: finally!</p> <p>So, now that we know what hides behind each of these standards we can start tackling our problem.<br/> <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/aftab/2640901551/" title="Hide n Seek de aftab., sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm4.static.flickr.com/3026/2640901551_e40cb9bd4e.jpg" width="500" height="333" alt="Hide n Seek"/></a></p> <h2> A solution ?</h2> <h3> Rely on existing libraries, when performant</h3> <p>For flickr Desktop client (<a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/apps/72157620182196244/">Windows</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/services/apps/72157619108149732/">Mac</a>), we are using <b><a href="https://web.archive.org/web/20130503115014/http://www.exiv2.org/">Exiv2</a></b> Image metadata library, which helps the initial reconciliation between all fields (especially with EXIF and IPTC-IIM contained within XMP).</p> <h3>The <b>“guesstimation”</b> of character set from EXIF</h3> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/crystaljingsr/3914731787/" title="坐在问号足球上的3D小人高清图片_zcool.com.cn de 姒儿喵喵, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm3.static.flickr.com/2505/3914731787_739cace4f8.jpg" width="500" height="500" alt="坐在问号足球上的3D小人高清图片_zcool.com.cn"/></a><br/> We first scan the string to see if all bytes are in the range: 0 to 127. If so, we treat the string as <b>ASCII</b>. If not, we scan the string to see if it is consistent with valid UTF-8. If so, we treat the string as UTF-8. Checking against <b>UTF8</b> validity is not a bullet-proof test. But statistically, this is better than any other scenario. At the last resort, we pick a <b>“reasonable”</b> fallback encoding. For the desktop application, we use <b>hints</b> from the user system. On windows, the <a href="https://web.archive.org/web/20130503115014/http://msdn.microsoft.com/en-us/library/dd318101%28VS.85%29.aspx">GetLocaleInfo</a> function provides with the user default ANSI code page (<a href="https://web.archive.org/web/20130503115014/http://msdn.microsoft.com/en-us/library/dd373761%28VS.85%29.aspx">LOCALE_IDEFAULTANSICODEPAGE</a>), which can be used to specify an appropriate <a href="https://web.archive.org/web/20130503115014/http://msdn.microsoft.com/en-us/library/wyzd2bce.aspx">locale</a> for string conversion methods. On Mac OS X, <a href="https://web.archive.org/web/20130503115014/http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CFStringRef/Reference/reference.html#//apple_ref/c/func/CFStringGetSystemEncoding">CFStringGetSystemEncoding</a> is our ally. In our case, there is no point to use the characterset of our own application, which we control and is not linked to the characterset of the application that “wrote” the EXIF.</p> <h3>Consolidation: the easy case</h3> <p>The workflow followed by the image we handle is unknown. We can have all 3 formats filled-in but not necessarily by the same application. So, we need a mechanism to consolidate the data. The easy case is for single field such as title and description. We follow the obvious <b>quality hierarchy</b> of the different formats. To extract the description for instance, we first look for the XMP.dc.description field, then XMP.photoshop.Headline (to support the extensibility mentioned before as a side note), then IPTC.Application2.Caption and finally the Exif.Image.ImageDescription. We only keep the first data found and ignore the others. There is only one title and one description per image: might as well take the one we are sure about.</p> <h3>Consolidation: it becomes even trickier for tags.</h3> <p><a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/tcp909/132665279/" title="puzzle pieces de tcp909, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm1.static.flickr.com/48/132665279_ce10c3b2ca.jpg" width="500" height="317" alt="puzzle pieces"/></a><br/> The singleness of the final result disappearing (we deal with a list of tags, not just one single tag), we cannot ignore the “EXIF” tags as easily as for the title and the description case. Fortunately, IPTC Keywords are supposed to be <b>mapped</b> to XMP (dc:subject). Therefore we can take into account the number of keywords that would be extracted from EXIF and the number that would be extracted from XMP. If those equal, we plainly ignore the EXIF. If they don’t, we try to match each guestimation of EXIF keyword against the XMP keywords to <b>avoid duplicates</b>.<br/>  <br/> All in one, quite an interesting issue where, per design, the final solution is going to be an <b>approximation</b> with different results depending on the <b>context</b>. Computers: an exact science?<br/> <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/laughingsquid/102653657/" title="Computer History Museum de Laughing Squid, sur Flickr"><img src="https://web.archive.org/web/20130503115014im_/http://farm1.static.flickr.com/33/102653657_332bbf3b63.jpg" width="500" height="333" alt="Computer History Museum"/></a></p> <p>For more information and main reference: <a href="https://web.archive.org/web/20130503115014/http://www.metadataworkinggroup.com/">http://www.metadataworkinggroup.com/</a></p> <p>Photos by <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/groume/">Groume</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/tchi-tcha/">Raïssa Bandou</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/mcgraths/">seanmcgrath</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/tcp909/">tcp909</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/aftab/">aftab.</a>, <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/crystaljingsr/">姒儿喵喵</a> and <a href="https://web.archive.org/web/20130503115014/http://www.flickr.com/photos/laughingsquid/">Laughing Squid</a></p> <div id="jp-post-flair" class="sharedaddy sd-like-enabled sd-sharing-enabled"></div> </div><!-- .entry-content --> <footer class="entry-meta"> <span class="cat-links"> <span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/uploadr/" title="View all posts in uploadr" rel="category tag">uploadr</a> </span> <span class="sep"> | </span> <span class="tag-links"> <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/tag/characterset/" rel="tag">characterset</a>, <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/tag/encoding/" rel="tag">encoding</a>, <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/tag/exif/" rel="tag">exif</a>, <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/tag/i18n/" rel="tag">i18n</a>, <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/tag/international/" rel="tag">international</a> </span> </footer><!-- .entry-meta --> </article><!-- #post-1239 --> </div><!-- #content --> </section><!-- #primary --> <div id="secondary" class="widget-area" role="complementary"> <aside id="search-2" class="widget widget_search"> <form method="get" id="searchform" action="https://web.archive.org/web/20130503115014/http://code.flickr.net/"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" id="s" placeholder="Search"/> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"/> </form> </aside> <aside id="recent-posts-2" class="widget widget_recent_entries"> <h3 class="widget-title">Recent Posts</h3> <ul> <li> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2013/03/26/using-redis-as-a-secondary-index-for-mysql/" title="Using Redis as a Secondary Index for MySQL">Using Redis as a Secondary Index for&nbsp;MySQL</a> </li> <li> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/12/21/redis-global-locks-redux/" title="Redis Global Locks Redux">Redis Global Locks&nbsp;Redux</a> </li> <li> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/12/12/highly-available-real-time-notifications/" title="Highly Available Real Time Push Notifications and You">Highly Available Real Time Push Notifications and&nbsp;You</a> </li> <li> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/12/10/drag-n-drop/" title="Avoiding Dragons: A Practical Guide to Drag ’n’ Drop">Avoiding Dragons: A Practical Guide to Drag&nbsp;’n’&nbsp;Drop</a> </li> <li> <a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/10/26/flickr-at-sf-web-performance/" title="Flickr at SF Web Performance">Flickr at SF Web&nbsp;Performance</a> </li> </ul> </aside><aside id="archives-2" class="widget widget_archive"><h3 class="widget-title">Archives</h3> <ul> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2013/03/" title="March 2013">March 2013</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/12/" title="December 2012">December 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/10/" title="October 2012">October 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/07/" title="July 2012">July 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/06/" title="June 2012">June 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/05/" title="May 2012">May 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/04/" title="April 2012">April 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/02/" title="February 2012">February 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2012/01/" title="January 2012">January 2012</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/12/" title="December 2011">December 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/10/" title="October 2011">October 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/09/" title="September 2011">September 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/08/" title="August 2011">August 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/07/" title="July 2011">July 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/06/" title="June 2011">June 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/03/" title="March 2011">March 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/02/" title="February 2011">February 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2011/01/" title="January 2011">January 2011</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/11/" title="November 2010">November 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/10/" title="October 2010">October 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/09/" title="September 2010">September 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/08/" title="August 2010">August 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/07/" title="July 2010">July 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/05/" title="May 2010">May 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/04/" title="April 2010">April 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/03/" title="March 2010">March 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/02/" title="February 2010">February 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2010/01/" title="January 2010">January 2010</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/12/" title="December 2009">December 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/11/" title="November 2009">November 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/10/" title="October 2009">October 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/09/" title="September 2009">September 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/07/" title="July 2009">July 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/06/" title="June 2009">June 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/05/" title="May 2009">May 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/04/" title="April 2009">April 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/03/" title="March 2009">March 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/02/" title="February 2009">February 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2009/01/" title="January 2009">January 2009</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/12/" title="December 2008">December 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/11/" title="November 2008">November 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/10/" title="October 2008">October 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/09/" title="September 2008">September 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/08/" title="August 2008">August 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/07/" title="July 2008">July 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/06/" title="June 2008">June 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/05/" title="May 2008">May 2008</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/2008/04/" title="April 2008">April 2008</a></li> </ul> </aside><aside id="categories-2" class="widget widget_categories"><h3 class="widget-title">Categories</h3> <ul> <li class="cat-item cat-item-564792"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/change-log/" title="View all posts filed under changelog">changelog</a> </li> <li class="cat-item cat-item-5784"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/event/" title="View all posts filed under event">event</a> </li> <li class="cat-item cat-item-29160"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/geo/" title="All things geo related">geo</a> </li> <li class="cat-item cat-item-34412"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/kittens/" title="View all posts filed under kittens">kittens</a> </li> <li class="cat-item cat-item-171"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/meta/" title="View all posts filed under meta">meta</a> </li> <li class="cat-item cat-item-1"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/uncategorized/" title="View all posts filed under Uncategorized">Uncategorized</a> </li> <li class="cat-item cat-item-249276"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/uploadr/" title="View all posts filed under uploadr">uploadr</a> </li> <li class="cat-item cat-item-830560"><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/category/xulrunner/" title="View all posts filed under xulrunner">xulrunner</a> </li> </ul> </aside><aside id="meta-2" class="widget widget_meta"><h3 class="widget-title">Meta</h3> <ul> <li><a href="https://web.archive.org/web/20130503115014/http://wordpress.com/signup/?ref=wplogin">Register</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://flickrcode.wordpress.com/wp-login.php">Log in</a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/feed/" title="Syndicate this site using RSS 2.0">Entries <abbr title="Really Simple Syndication">RSS</abbr></a></li> <li><a href="https://web.archive.org/web/20130503115014/http://code.flickr.net/comments/feed/" title="The latest comments to all posts in RSS">Comments <abbr title="Really Simple Syndication">RSS</abbr></a></li> Powered by <a href="https://web.archive.org/web/20130503115014/http://vip.wordpress.com/" rel="generator nofollow" class="powered-by-wpcom">WordPress.com VIP</a> </ul> </aside> </div><!-- #secondary .widget-area --> </div><!-- #main --> <footer id="colophon" role="contentinfo"> <div id="site-generator"> Theme: Twenty Eleven <span class="sep"> | </span> Powered by <a href="https://web.archive.org/web/20130503115014/http://vip.wordpress.com/" rel="generator nofollow" class="powered-by-wpcom">WordPress.com VIP</a> </div> </footer><!-- #colophon --> </div><!-- #page --> <script type="text/javascript"> var _qevents = _qevents || [], wpcomQuantcastData = {"qacct":"p-18-mFEk4J448M","labels":",language.en,type.wpcom,vip.flickrcode"}; function wpcomQuantcastPixel( labels, options ) { var i, defaults = wpcomQuantcastData, data = { event: 'ajax' }; labels = labels || ''; options = options || {}; if ( typeof labels != 'string' ) options = labels; for ( i in defaults ) { data[i] = defaults[i]; } for ( i in options ) { data[i] = options[i]; } if ( data.labels ) { data.labels += ',' + labels; } else { data.labels = labels; } _qevents.push( data ); }; (function() {var elem = document.createElement('script');elem.src = (document.location.protocol == "https:" ? "https://web.archive.org/web/20130503115014/https://secure" : "https://web.archive.org/web/20130503115014/http://edge") + ".quantserve.com/quant.js";elem.async = true;elem.type = "text/javascript";var scpt = document.getElementsByTagName('script')[0];scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push( wpcomQuantcastData ); </script> <noscript><div style="display: none;"><img src="//web.archive.org/web/20130503115014im_/http://pixel.quantserve.com/pixel/p-18-mFEk4J448M.gif?labels=%2Clanguage.en%2Ctype.wpcom%2Cvip.flickrcode" height="1" width="1" alt=""/></div></noscript> <script type="text/javascript" src="//web.archive.org/web/20130503115014js_/http://0.gravatar.com/js/gprofiles.js?ver=201318ac"></script> <script type="text/javascript"> /* <![CDATA[ */ var WPGroHo = {"my_hash":""}; /* ]]> */ </script> <script type="text/javascript" src="https://web.archive.org/web/20130503115014js_/http://s0.wp.com/wp-content/mu-plugins/gravatar-hovercards/wpgroho.js?m=1351637563g"></script> <script>jQuery(document).ready(function($){ Gravatar.profile_cb = function( h, d ) { WPGroHo.syncProfileData( h, d ); }; Gravatar.my_hash = WPGroHo.my_hash; Gravatar.init( 'body', '#wp-admin-bar-my-account' ); });</script> <div style="display:none"> </div> <script type="text/javascript" src="https://web.archive.org/web/20130503115014js_/http://s0.wp.com/wp-content/js/devicepx.js?m=1354656609g"></script> <script type="text/javascript"> // <![CDATA[ (function() { try{ if ( window.external &&'msIsSiteMode' in window.external) { if (window.external.msIsSiteMode()) { var jl = document.createElement('script'); jl.type='text/javascript'; jl.async=true; jl.src='/wp-content/plugins/ie-sitemode/custom-jumplist.php'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jl, s); } } }catch(e){} })(); // ]]> </script><script src="https://web.archive.org/web/20130503115014js_/http://s.stats.wordpress.com/w.js?21" type="text/javascript"></script> <script type="text/javascript"> st_go({'blog':'39034126','v':'wpcom','tz':'0','user_id':'0','subd':'flickrcode'}); function st_vt() {var x=document.createElement("img");x.src="https://web.archive.org/web/20130503115014/http://stats.wordpress.com/g.gif?blog=39034126&v=wpcomvt&tz=0&user_id=0&subd=flickrcode&rand="+Math.random();} ex_go({'crypt':'UE40eW5QN0p8M2Y/RE1BNmNJfGhxNCVxUDExYmtXRThKbHcwXTdETWI1alhvb1oseHImN101ZFpEakVpYjlQYVFLYzBaVHRtPz0wXS9bM1lKdVZKQS1NTGJmdUM0ZHJxVkdbSmJHXy45cWp6UEwwZUM/ZjMuP3ZrOFE9SmJ4Lmtta1t0em1GQkc3PVVjLSxyVWRWOFp8cHBkcyV5YXVVfm93aEZFc1orLFNsYzc4fiVRXU9+dE14SWExX1s4K2Nkam4vQmddZkRXbEE4T1QuUCVRP3c1WHBuZ3EvQT8mWj0ySmRQPSssK1Nqcy5KLGhUNGpycFJ8emkrLy9k'}); addLoadEvent(function(){linktracker_init('39034126',0);}); </script> <noscript><img src="https://web.archive.org/web/20130503115014im_/http://stats.wordpress.com/b.gif?v=noscript" style="height:0px;width:0px;overflow:hidden" alt=""/></noscript> </body> </html><!-- FILE ARCHIVED ON 11:50:14 May 03, 2013 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 16:44:25 Mar 03, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.896 exclusion.robots: 0.062 exclusion.robots.policy: 0.044 esindex: 0.015 cdx.remote: 19.012 LoadShardBlock: 224.037 (3) PetaboxLoader3.datanode: 240.239 (4) load_resource: 139.914 PetaboxLoader3.resolve: 80.563 -->

Pages: 1 2 3 4 5 6 7 8 9 10