X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=blobdiff_plain;f=includes%2Fmedia%2FXMP.php;h=36660b3dcc95126d13e5b8b3def084358ffd1144;hb=67bfdc7a68940d901e585eadd984a2074bf0216a;hp=adb85df884da9ffb5d8fa917301219a6a4c7b2cc;hpb=01f36b721f6fb60000b625fd681993d50ebd0e40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/XMP.php b/includes/media/XMP.php index adb85df884..36660b3dcc 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -213,10 +213,16 @@ class XMPReader { unset( $data['xmp-special'] ); // Convert GPSAltitude to negative if below sea level. - if ( isset( $data['xmp-exif']['GPSAltitudeRef'] ) ) { - if ( $data['xmp-exif']['GPSAltitudeRef'] == '1' - && isset( $data['xmp-exif']['GPSAltitude'] ) - ) { + if ( isset( $data['xmp-exif']['GPSAltitudeRef'] ) + && isset( $data['xmp-exif']['GPSAltitude'] ) + ) { + + // Must convert to a real before multiplying by -1 + // XMPValidate guarantees there will always be a '/' in this value. + list( $nom, $denom ) = explode( '/', $data['xmp-exif']['GPSAltitude'] ); + $data['xmp-exif']['GPSAltitude'] = $nom / $denom; + + if ( $data['xmp-exif']['GPSAltitudeRef'] == '1' ) { $data['xmp-exif']['GPSAltitude'] *= -1; } unset( $data['xmp-exif']['GPSAltitudeRef'] ); @@ -461,13 +467,15 @@ class XMPReader { * generally means we've finished processing a nested structure. * resets some internal variables to indicate that. * - * Note this means we hit the not the . + * Note this means we hit the closing element not the "". * - * For example, when processing: + * @par For example, when processing: + * @code{,xml} * 64 * + * @endcode * - * This method is called when we hit the tag. + * This method is called when we hit the "" tag. * * @param $elm String namespace . space . tag name. */ @@ -523,15 +531,17 @@ class XMPReader { * Hit a closing element in MODE_LI (either rdf:Seq, or rdf:Bag ) * Add information about what type of element this is. * - * Note we still have to hit the outer + * Note we still have to hit the outer "" * - * For example, when processing: + * @par For example, when processing: + * @code{,xml} * 64 * + * @endcode * - * This method is called when we hit the . + * This method is called when we hit the "". * (For comparison, we call endElementModeSimple when we - * hit the ) + * hit the "") * * @param $elm String namespace . ' ' . element name */ @@ -1010,7 +1020,7 @@ class XMPReader { * Also does some initial set up for the wrapper element * * @param $parser XMLParser - * @param $elm String namespace element + * @param $elm String namespace "" element * @param $attribs Array attribute name => value */ function startElement( $parser, $elm, $attribs ) { @@ -1093,11 +1103,13 @@ class XMPReader { * Process attributes. * Simple values can be stored as either a tag or attribute * - * Often the initial tag just has all the simple + * Often the initial "" tag just has all the simple * properties as attributes. * - * Example: + * @par Example: + * @code * + * @endcode * * @param $attribs Array attribute=>value array. */