.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt =================== EXT: Metadata in TS =================== :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: Xavier Perseguers :Changed: 2010-08-22T12:05:08 :Classification: metadata_ts :Keywords: exif, iptc, xmp, metadata, picture, photo, image :Author: Xavier Perseguers :Email: typo3@perseguers.ch :Info 3: :Info 4: |img-1| |img-2| EXT: Metadata in TS - metadata\_ts .. _EXT-Metadata-in-TS: EXT: Metadata in TS =================== Extension Key: metadata\_ts Language: Keywords: exif, iptc, xmp, metadata, picture, photo, image Copyright 2008-2010, Xavier Perseguers This document is published under the Open Content Licenseavailable from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: Metadata in TS 1 <#__RefHeading__2236_111854446>`_ **`Introduction 3 <#__RefHeading__1893_111854446>`_** `What does it do? 3 <#__RefHeading__1895_111854446>`_ `Screenshots 3 <#__RefHeading__1897_111854446>`_ **`Users manual 4 <#__RefHeading__1899_111854446>`_** **`Administration 5 <#__RefHeading__1901_111854446>`_** **`Configuration 6 <#__RefHeading__1903_111854446>`_** `Extension Configuration 6 <#__RefHeading__1905_111854446>`_ `Reference 6 <#__RefHeading__1907_111854446>`_ **`Tutorial 8 <#__RefHeading__1909_111854446>`_** `Photo gallery 8 <#__RefHeading__1911_111854446>`_ `Automatically rotating pictures 8 <#__RefHeading__1913_111854446>`_ **`Known problems 10 <#__RefHeading__1915_111854446>`_** **`To-Do list 11 <#__RefHeading__1917_111854446>`_** **`Further information 12 <#__RefHeading__2240_111854446>`_** **`Have more fun with TYPO3! 12 <#__RefHeading__2242_111854446>`_** **`ChangeLog 13 <#__RefHeading__1919_111854446>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension lets users extract metadata from files using TypoScript. .. _Screenshots: Screenshots ^^^^^^^^^^^ A screenshot does not make much sense but I know that it is visually more impressive with one. Thus here is a screenshot of a sample picture I watermarked dynamically with the photograph's name. |img-3| .. _Users-manual: Users manual ------------ The screenshot was created with TS below: :: page = PAGE page.10 = IMAGE page.10.file = GIFBUILDER page.10.file { XY = [10.w],[10.h] 10 = IMAGE 10.file = EXT:metadata_ts/samples/wbtc05.jpg 10.file.maxW = 400 20 = TEXT 20 { offset = [10.w]-[20.w]-10,[10.h]-[20.h]+5 fontColor = #ffffff fontSize = 15 text.cObject = FILEINFO text.cObject { file.data = TSFE:lastImageInfo|origFile metadata.field = EXIF:Author // IPTC:2#080|0 noTrimWrap = |(c) | | } } } .. _Administration: Administration -------------- Install the extension as usual. .. _Configuration: Configuration ------------- .. _Extension-Configuration: Extension Configuration ^^^^^^^^^^^^^^^^^^^^^^^ External tools may be specified for extracting EXIF and IPTC data. This is particularly useful if you encounter character set conversion problems with PHP built-in methods for dealing with EXIF and IPTC information. This extension was tested with command-line tools “exif” and “exiv2”. Proper parameters should ensure that a machine-readable output is generated. The key column is used in TypoScript to retrieve a given value. .. _exif: exif """" Suggested configuration: :: /usr/bin/exif -m -i Output will be something like this: :: 0x010f Canon 0x0110 Canon EOS 300D DIGITAL 0x0112 top - left 0x011a 180.00 0x011b 180.00 0x0128 Inch 0x0131 Adobe Photoshop CS3 Macintosh 0x0132 2008:07:19 10:46:01 0x013b Xavier Perseguers 0x0213 centered 0x0103 JPEG compression 0x011a 72.00 0x011b 72.00 0x0128 Inch 0x829a 1/1000 sec. 0x829d f/7.1 ... Columns in the output are separated by a tabulator (“\t”), Key column is at position 0 and Value column at position “1”. .. _exiv2: exiv2 """"" Suggested configuration: :: /usr/bin/exiv2 -px Output will be something like this: :: Xmp.exif.ExposureTime XmpText 6 1/1000 Xmp.exif.FNumber XmpText 5 F7.1 Xmp.exif.ExifVersion XmpText 4 2.21 Xmp.exif.DateTimeOriginal XmpText 25 2005-07-09T13:20:45+01:00 Xmp.exif.DateTimeDigitized XmpText 25 2005-07-09T13:20:45+01:00 Xmp.exif.CompressedBitsPerPixel XmpText 3 3/1 Xmp.exif.ShutterSpeedValue XmpText 12 1/1000 s Xmp.exif.ApertureValue XmpText 12 F7.1 Xmp.exif.ExposureBiasValue XmpText 3 0 Xmp.exif.MaxApertureValue XmpText 12 194698/65536 Xmp.exif.MeteringMode XmpText 1 Multi-segment Xmp.exif.FocalLength XmpText 4 70.0 mm Xmp.exif.FlashpixVersion XmpText 4 1.00 Xmp.exif.ColorSpace XmpText 1 sRGB Xmp.exif.PixelXDimension XmpText 4 1280 Xmp.exif.PixelYDimension XmpText 3 853 Xmp.exif.FocalPlaneXResolution XmpText 11 3443.95 Xmp.exif.FocalPlaneYResolution XmpText 11 3442.02 Xmp.exif.FocalPlaneResolutionUnit XmpText 1 inch Xmp.exif.SensingMethod XmpText 1 One-chip color area Xmp.exif.FileSource XmpText 1 Digital still camera ... Columns are separated by one or more spaces (“\s+”), Key column is at position 0 and Value column at position 3. .. _Reference: Reference ^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _file-stdWrap: file /+stdWrap """""""""""""" .. container:: table-row Property file /+stdWrap Data type wrap Description Defines the file to extract metadata from Default .. _metadata-field: metadata.field """""""""""""" .. container:: table-row Property metadata.field Data type fieldname Description Sets the content to the value $cObj->data[metata.field] Example: Set content to the value of field “Xmp.exif.ExposureTime”. As it is an EXIF data, prefix it with “EXIF:” and set “.metadata.field = EXIF:Xmp.exif.ExposureTime” $cObj->data changes. Activate debug mode to list available keys! Note: You can also divide fieldnames by “//”. Say, you set “EXIF:Author // IPTC:2#080\|0” as the value, then the content from the field EXIF:Author will be returned unless it is a blank string, in which case field IPTC:2#080\|0 is returned. Default .. _debug: debug """"" .. container:: table-row Property debug Data type boolean Description If set, content of $cObj->data is passed to standard method debug(). This is useful if you want to discover available fields that may be used to extract metadata. Default .. ###### END~OF~TABLE ###### [tsref:(FILEINFO)] .. _generated: ((generated)) """"""""""""" .. _Example: Example ~~~~~~~ Here you would show an example of the stuff from the reference or so: :: page = PAGE page.typeNum = 0 page.10 = FILEINFO page.10.file = EXT:metadata_ts/samples/wbtc05.jpg page.10.debug = 1 page.10.metadata.field = EXIF:Author // IPTC:2#080|0 .. _Tutorial: Tutorial -------- .. _Photo-gallery: Photo gallery ^^^^^^^^^^^^^ If you use a gallery extension such as chgallery and you have a lightbox extension (such as perfectlightbox) to show a single picture, then you may use following code to use the IPTC description as title for lightbox: :: plugin.tx_chgallery_pi1.gallery.image { file { maxW = 139 maxH = 110 } imageLinkWrap = 1 imageLinkWrap { enable = 1 typolink { title.override.cObject = FILEINFO title.override.cObject { file.data = TSFE:lastImageInfo|origFile metadata.field = EXIF:Subject // IPTC:2#005|0 // IPTC:Xmp.dc.title } parameter.override.cObject = IMG_RESOURCE parameter.override.cObject.file.import.data = TSFE:lastImageInfo|origFile parameter.override.cObject.file.maxW = 800 parameter.override.cObject.file.maxH = 600 ATagParams = rel="lightbox" ATagParams.override = rel="lightbox[presentlb{field:uid}]" ATagParams.insertData = 1 } } } .. _Automatically-rotating-pictures: Automatically rotating pictures ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Following code will automatically rotate the picture you specify. Many newer digital cameras (both dSLR and Point & Shoot digicams) have a built-in orientation sensor. Virtually all Canon and Nikon digital cameras have an orientation sensor. The output of this sensor is used to set the EXIF orientation flag in the image file's metadata to reflect the positioning of the camera with respect to the ground. Canon calls their sensor the “Intelligent Orientation” sensor. It is presumably a 2-axis tilt sensor, allowing 4 possible orientations to be detected (shown in the diagram below): |img-4| :: page.10 = CASE page.10.key.cObject = FILEINFO page.10.key.cObject.file = fileadmin/photos/IMG_1040.JPG page.10.key.cObject.metadata.field = EXIF:Orientation # Orientation is landscape page.10.default = IMAGE page.10.default { file < page.10.key.cObject.file file.maxH = 400 file.maxW = 400 altText.cObject < page.10.key.cObject altText.cObject.metadata.field = IPTC:2#005|0 } # Orientation is portrait page.10.6 < page.10.default page.10.6.file.params = -rotate 90 page.10.8 < page.10.default page.10.8.file.params = -rotate -90 .. _Known-problems: Known problems -------------- None .. _To-Do-list: To-Do list ---------- - Supporting other metadata as EXIF and IPTC for pictures - Supporting any file type that may contain metadata (sound, PDF, movies, ...) - Using metaExtract\* services instead of recoding all metadata extraction procedures .. _Further-information: Further information ------------------- Do not hesitate to visit the extension's website on Forge: `http://forge.typo3.org/projects/show/extension-metadata\_ts `_ Have more fun with TYPO3! .. _ChangeLog: ChangeLog --------- See file Changelog. 13 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 356 .. :id: graphics1 .. :name: graphics1 .. :width: 533 .. |img-4| image:: img-4.png .. :align: bottom .. :border: 0 .. :height: 289 .. :id: graphics8 .. :name: graphics8 .. :width: 303