Esperado
Posts: 5
Joined: Wed Nov 21, 2018 12:24 am

Hack of Highslide: popup *from* the expanded image window.

Hi,
Congratulation for your fantastic hislide.

My problem is the following:
My site use Joomla 1.5.
I have hacked Highslide in order to add 3 buttons and some contents in the expanded view.
the buttons are added in the captiontext.
Https://www.street-photo.fr (you can see the gallery there and expand an image.
Those 3 buttons are PHP files that i would like to call in Ajax and create a new pop-up window on the top of the big image, the way it works there:
https://www.street-photo.fr/forum/profi ... ?user_id=1 click on an image).

Modal of Joomla does not work because the A tags does not exists yet when "domready".. and I don-t succeed to call-it manually. from your imageloader.php.

My question is, may I use HS to do this in a simple and light way or did-I have to call an other popup box ?
Too, it seems that you are modifying somewhere the content passed in imageloader via captionText:.
If I add an url via an added "onclick", like /bla/bli/myphp.php?url=/toto/{img} the "/" outside of the {img} are replaced by spaces, it does not help ;-).

Thanks in advance and, again, deep congratulations.
Christophe Esperado.
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Hack of Highslide: popup *from* the expanded image window.

Highslide JS is abandonware, totally unsupported. There hasn't been a substantive update of the script since 2011. So, I would strongly advise against adopting Highslide JS for any new projects.

You'd be better off with something more up-to-date, and more actively supported. You might want to take a look at Floatbox. Here's a page of demo's: https://floatboxjs.com/demo

ETA: "Actively supported" isn't quite correct. The developer of Floatbox is a real piece of work. At this point he's not open to suggestions for new features. When it comes to bugs, he'll fix something if it matters to him. If he doesn't care about the bug you're reporting, good luck. ;)
Esperado
Posts: 5
Joined: Wed Nov 21, 2018 12:24 am

Re: Hack of Highslide: popup *from* the expanded image window.

Hi, MisterNeutron,
Thank-you for your answer.
So I believe I have to find by myself the way to fix my problem ( despite my hate for the javascript syntax and the pain to debug-it. ;-)
It is a pity highslide has been abandoned, and the developer stopped his support as it was, too, a "real piece of work" (and my hacks were too a big time consuming).
May-i propose-you a suggestion: to clearly indicate the death of this artwork on your web site. It will save time for you and the users.

Regards,
Christophe
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Hack of Highslide: popup *from* the expanded image window.

There is nothing about Highslide JS on my website. I don't work for Highcharts/Highslide JS - I'm just a user. But you are correct - this website should be more clear about the status of Highslide JS. The old examples are useful to anyone who is still using the software, as is the API. But the intro page and download page need to have a big red warning sign on them! BTW, the "Configurator" page has been broken for over a year - it doesn't work properly at all.

Sorry for using an English idiom that doesn't translate well. A "piece of work" refers to a person who is difficult and troublesome, someone who is very hard to work with. It's not a compliment. ;)
Esperado
Posts: 5
Joined: Wed Nov 21, 2018 12:24 am

Re: Hack of Highslide: popup *from* the expanded image window.

yes, MisterNeutron, it is a pity that such a good work falls in a black hole, because the author seems to be exhausted by this huge javascript volapuk ;-).
I managed to make-it working as expected, fighting with the code and z-indexes.
I still have something to set:
You can see-it at https://street-photo.fr .
I want to pause the autoplay when I click on my button "exif".
Tried to call the "pause" function that exists in the prototype hs.Slideshow, this way:
[code<script type="text/javascript">
var MySqueezeBox = {
loadModal: function(modalUrl,handler,x,y) {

var a = new hs.Slideshow();
a.pause();
/*
for(var parameter in a) {
console.log(parameter+' => '+a);
}
*/
var options = $merge(options || {}, Json.evaluate("{handler: '" + handler + "', size: {x: " + x +", y: " + y + "}}"));
this.setOptions(this.presets, options);
this.assignOptions();
this.setContent(handler,modalUrl);
},
extend: $extend
}
document.addEventListener('DOMContentLoaded', function () {
MySqueezeBox.extend(SqueezeBox);
MySqueezeBox.initialize({});
})

document.addEventListener('DOMContentLoaded', function () {
var el = document.getElementById("sbox-btn-close");
el.addEventListener("click", closeme, false);
})

function closeme(){
window.parent.document.getElementById('sbox-window').close();
};
</script>[/code]

No error, but nothing happens. Despite the function "pause" appears as an object in the console when I call the "a" properties.
Some help, please ? ( I'm not good at all with Javascript).
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Hack of Highslide: popup *from* the expanded image window.

Esperado wrote: Sat Nov 24, 2018 1:51 am I want to pause the autoplay when I click on my button "exif".
I'm not really a "Javascript guy," either. But I think you need something like this in your button onclick:

Code: Select all

hs.getExpander().slideshow.pause();
Esperado
Posts: 5
Joined: Wed Nov 21, 2018 12:24 am

Re: Hack of Highslide: popup *from* the expanded image window.

Thanks a lot for your help, MisterNeutron.
You were damn right.
My working code:

Code: Select all

<script type="text/javascript">
var MySqueezeBox = {
    loadModal: function(modalUrl,handler,x,y) {
       hs.getExpander().slideshow.pause();
       var options = $merge(options || {}, Json.evaluate("{handler: '" + handler + "', size: {x: " + x +", y: " + y + "}}"));      
       this.setOptions(this.presets, options);
       this.assignOptions();
       this.setContent(handler,modalUrl);
   },
	extend: $extend	
}
// document.getElementById("exif-button").addEventListener("click", hs.Slideshow.prototype.pause());

document.addEventListener('DOMContentLoaded', function () {
    MySqueezeBox.extend(SqueezeBox);
    MySqueezeBox.initialize({});
})
document.addEventListener('DOMContentLoaded', function () {
   var el = document.getElementById("sbox-btn-close");
   el.addEventListener("click", closeme, false);
})

function closeme(){
	window.parent.document.getElementById('sbox-window').close();
};
</script>
Called with this (too lazy to set a onclick event listener ;-) )

Code: Select all

<a class="exif-button" title="Voir les Exifs et XMPs de cette photo." id="exif-button" href="javascript: void(0)" onclick="MySqueezeBox.loadModal('/forum/j_iptc?url=url-of-the-photo','iframe',350,430)"> <span>Exifs</span></a>
Esperado
Posts: 5
Joined: Wed Nov 21, 2018 12:24 am

Re: Hack of Highslide: popup *from* the expanded image window.

And, for those who could be interested in decoding and showing the exif/XMP of an image, my original code (working if ADOBE doesn't change his protocol :-( ):

Code: Select all

<?php
defined ('IN_AGORA') or die ('Bad request 207');
//Charset utf8
// Licence GNU
// Copyright: Christope Esperado. //

// Taille de l'image à analyser à déterminer par vous (80000 semble une bonne valeur)
$size_exif = 80000;
// Choisir 0 pour une sortie ALERT box 1 pour une sortie HTML
$form = 1;
$url_img = "http://".trim(Agora::getRequestVar('url'));
// Chemin en dur du dossier dans lequel seront sauvés les exifs  le temps de l'opération terminé par / ou \
$temp = AGORA_PATH.'img'.DS.'members'.DS.'temp'.DS;
// Dossier du plus bas niveau possible contenant vos images, terminé par / ou \
$dossier = AGORA_PATH.'img'.DS.'members'.DS;
//##################/Fin réglages utilisateur #####################
//#################### Mise en forme ########################

// Non connecté:: accès refusé
$user =& JFactory::getUser();
/*
if(! $user->get('name')) {
$returnno = '
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Exifs</title>
</head>

<body id="bd" class="fs3" style="background:#333; background-image: url(/images/no-xmp.jpg); margin-left:15px;margin-top:15px;overflow:hidden;line-height:17px;">
&nbsp;
</body>';
print $returnno;
exit();
}
*/
// fin non connectés;
if($form ==0) {
$in_titre = $end_tag = $in_value = $endbody = $in_warn = $titre = $copyright = "";
$break = "\n" ;
} else {
$in_titre = "<span class=\"xmp-titre\" style=\"font-weight:bold;color:#FDD017;\">";
$end_tag = "</span>";
$in_value = "<span class=\"xmp-value\" style=\"color:#DDD;\">"; 
$break = "<br/>";
$in_warn = "<span class=\"xmp-warn\" style=\"color:#77CCFF;font-style: italic;font-size:12px;line-height:98%;\">";
$head= '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-fr" lang="fr-fr" dir="ltr" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Exifs</title>
</head>

<body id="bd" class="fs3" style="background:#333; background-image: url(/images/fond-xmp.jpg); margin-left:15px;margin-top:15px;overflow:hidden;line-height:17px;">';
$endbody = '</body>';
$titre = '<div style="font-size :18px;color:#FDD017; text-align:center;margin-bottom15px;">EXIFS &amp; XMP</div>';
$copyright ='<div style="height:12px;margin-left:273px;margin-bottom:0px;font-size:10px; color:#77CCFF;margin-right:15px;position:absolute;margin-top:389px;clear:none;">©Esperado</div>'; 
$centre = '<span style="text-align:center;width: 100%; display:block;clear:none;margin-bottom:4px;color: #DDD;">';
}
$affiche = $head.$copyright.$titre;
//#################### /Fin Mise en forme ######################
// test  valide url
if ( !preg_match('#^http(s)?://[a-z0-9-_]+(.[a-z0-9-_]+)*(:[0-9]+)?(/.*)?\.(jpg|jpeg)$#i', $url_img )) 
{
	exit($centre.$url_img.$end_tag.$break.$break.$centre."Ceci n'est pas une url d'image valide !!!".$end_tag);
}
	
//fichier distant
$external = "internal";
if( !preg_match("#street.photo.fr(.*)#", $url_img, $imgfilename)) {
	$datas = @file_get_contents($url_img, NULL, NULL,0, $size_exif);
	if( $datas ) {
	$imgfilename = time().".jpg";
	$filename = $temp.$imgfilename;
	$external = file_put_contents($filename, $datas ) ;
	} else {
	exit($centre.$url_img.$$break.$break.$break.$centre."L'image distante n'existe plus sur ce serveur !".$break.$break."Utilisez de préférence le forum".$break."pour héberger vos images".$end_tag);
	}
	if( $external == $size_exif ) 
	{
		$affiche .= $centre.$url_img.$end_tag  ;
	} else {
		$affiche .= $break;
	}
} else {
		$affiche .= $break;

// fichier local
	if( preg_match("#members(.*)#", $url_img, $imgfilename))
	{
		$filename= $dossier.$imgfilename[1];
	} else {
		exit($in_warn.'Adresse locale de l\'image: invalide'.$end_tag);
	}
}

/* EXIF */
$tagfile ="";
$exif_exif = @exif_read_data($filename,'FILE, EXIF, IFD0', 0, 0);
if($exif_exif != "") {
	foreach ($exif_exif as $key => $value)
	{
		if(trim($value) != "")
		{
		
			if($key == "UndefinedTag:0xA434"){
				$key="Lens";
				$tagfile = "°";
			}
			if(trim($value) =="----") $value="Manuel (inconnu)";
			$exif[$key][0] = $value;
			$exif[$key][1] = "°";

		}
	}
}


/* MIME VALIDE ou QUITTE */
if($exif_exif['FileType'] != 2)	exit($break.$centre."L'image n'est pas un jpeg valide !".$break.$break."Ou elle a été supprimée du serveur".$end_tag);
unset($exif_exif);

/* XMP */
// limite de taille de lecture du fichier
$source= file_get_contents  ($filename, NULL, NULL, 0, $size_exif);

if( $source == false ) exit($in_warn.'Impossible d\'ouvrir le fichier'. $filename .$end_tag); 
$xmpdata_start = strpos($source,"<x:xmpmeta");
$xmpdata_end = strpos($source,"</x:xmpmeta>", $xmpdata_start);
$xmplenght = $xmpdata_end-$xmpdata_start;
$source = substr($source,$xmpdata_start,$xmplenght+12);

if( $xmplenght > 1000 ) {
	preg_match_all('#(exif|xap|xmp|aux|tiff|crs):([^=">]*)(>\s*<rdf:Seq>\s*<rdf:li)?(="|>)([^"<]*)#', $source, $result);
	if($result !="")
	{
	
// Surcharge les donnée EXIF éventuelles par les données XMP
	foreach ($result[2] as $i => $Key){

		if( trim($result[5][$i]) != "" && !is_array($result[5][$i]) )
		{ 
			if (strpos($result[2][$i],"Fired") !== false) $result[2][$i] = "Fired";	
			if(trim($Key) == "Lens" &&(trim($result[5][$i]) == "----" || trim($result[5][$i]) == "")) {
			}else{
				$exif[$result[2][$i]][0] = trim($result[5][$i]);
				$exif[$result[2][$i]][1] .= "*";
				if(trim($Key) == "Lens") $tagfile .= "*";
			}
		}
	}
		unset($result);	
	}
	unset($source);
/* end XMP */
}

$affiche .= '<div style="float:right;color:#5E5E5E;margin-top:-35px;margin-right:5px;">'.$xmpdata_end.'</div>';
// Efface la copie du fichier extérieur
if($external != "internal") unlink($filename);
 
if( $exif == false || $exif == "" ) exit($break.$centre."AUCUNE DONNéE MéTADATA".$break."trouvée dans cette photo.".$end_tag);
if( is_array($exif['ISOSpeedRatings'][0]))  {
	exit($break.$centre."Données exif corrompues, pas de xmp !".$end_tag);
	}
$metadata = false ;
								/* AFFICHAGE */
/* date */
		if( isset($exif['DateTimeOriginal'][0])){
			$datetotale[0] =  $exif['DateTimeOriginal'][0];
			$datetotale[1] =  $exif['DateTimeOriginal'][1];
		} elseif (isset($exif['CreateDate'][0])){
			$datetotale[0] =  $exif['CreateDate'][0];
			$datetotale[1] =  $exif['CreateDate'][1];
		} elseif ( isset( $exif['DateTimeDigitized'][0] )) {
			$datetotale[0] = $exif['DateTimeDigitized'][0];
			$datetotale[1] =  $exif['DateTimeDigitized'][1];
		}
		if(isset($datetotale)) {		
			preg_match("#([0-9]*).([0-9]*).([0-9]*)[T\s]([0-9]*):([0-9]*):([0-9]*)#",$datetotale[0],$out );// remise en forme de la date
			switch ($out[2]) {
			case "1" :$out[2] = "Jan";
			break;
			case "2" :$out[2] = "Fev";
			break;	
			case "3" :$out[2] = "Mar";
			break;	
			case "4" :$out[2] = "Avr";
			break;	
			case "5" :$out[2] = "Mai";
			break;	
			case "6" :$out[2] = "Juin";
			break;	
			case "7" :$out[2] = "Juil";
			break;	
			case "8" :$out[2] = "Aout";
			break;	
			case "9" :$out[2] = "Sep";
			break;	
			case "10" :$out[2] = "Oct";
			break;	
			case "11" :$out[2] = "Nov";
			break;	
			case "12" :$out[2] = "Dec";				
			}
			$affiche .= $mark.$in_titre."Photo prise le: ".$end_tag.$in_value.$out[3]." ".$out[2].".".$out[1]." à: ".$out[4]." h. ".$out[5]." ".$datetotale[1].$end_tag.$break.$break ;
		}		
 
/*Appareil	*/	
		if (isset($exif['Model'][0]) || isset($exif['Make'][0])){		
			if( $exif['Make'][0].$exif['Model'][0] == "" ) exit("Exifs Datas corrompues !"); 
			$make = split("/", $exif['Make'][0]);
			$exif['Make'][0] == $make[0];
			$make = split(" ", $exif['Make'][0]); //retire tout derriere le nom de la marque.
			$exif['Model'][0] = trim(str_replace($make[0],"",$exif['Model'][0]));
			$affiche .= $in_titre."Appareil: ".$end_tag.$in_value.strtoupper(trim($make[0])) . " ". $exif['Model'][0]." ".$exif['Make'][1].$end_tag.$break ;
			$metadata = true;
		}

/* Firmware et, ou  postproduction exifs */
		if( isset($exif['CreatorTool'][0]) ) {
			preg_match("#[^Adobe](.?)(Photoshop)?(.*)$#",$exif['CreatorTool'][0],$result);
			$exif['CreatorTool'][0] = trim($result[0]);
		// si firmware seul 
			$star= "*";
		}
		if ( isset($exif['Software'][0]) )
		{
			preg_match("#[^Adobe](.?)(Photoshop)?(.*)$#",$exif['Software'][0],$result);
			$exif['Software'][0] = trim($result[0]);
			if( strpos( $exif['Software'][0], "Ver") !== false ){
				$affiche .= $in_titre."Firmware : ".$end_tag.$in_value.$exif['Software'][0]." ".$exif['Software'][1].$end_tag.$break ;
				$metadata = true;
			} else {
				// Si pas xmp 
				if ( !isset($exif['CreatorTool'][0])){			
					$star="°";
				// si xmp identique
				} elseif ($exif['CreatorTool'][0] == $exif['Software'][0]){
					$star="°*";
				// si xmp différent
				} else {
				    $star="*";
				}
			}
			//si pas xmp ou xmp différent 			
			if( $star == "°") {
				$affiche .= $in_titre."Traitement : ".$end_tag.$in_value.$exif['Software'][0]." ".$star.$end_tag.$break ;
				$metadata = true;
			}
		}
			//si xmp seul   ou xmp différent
		if ( isset($exif['CreatorTool'][0]) && ($star != "°" ) )
		{
	

				$affiche .= $in_titre."Traitement: ".$end_tag.$in_value.$exif['CreatorTool'][0]." ".$star.$end_tag.$break ;
				$metadata = true;
		} 
            $affiche = str_replace ( "Windows" , "Win" , $affiche);
			$affiche = str_replace ( "Macintosh" ,"Mac",$affiche);
			$affiche = str_replace ( "Photoshop Lightroom", "Lightroom", $affiche);
			$affiche .= $break ;



/* Objectf */
		/* fichier*/
		$lens2= @file_get_contents  ($filename.".txt", NULL, NULL, 0, 10000);
		if( strpos( $lens2, "~~") !== false || $lens2 != false || $lens2 != ""){
			$lens_file = explode('~~', $lens2);	
			if( isset($lens_file[1]) && $lens_file[0] != ""){		
				$tagfile .= "¹";
				$fich = true;
			}
		}
		/*  xmp  */
	
		if (isset($exif['Lens'][0]) && $exif['Lens'][0]) {
			$lens[0] = $exif['Lens'][0];
			$lens[1] = $exif['Lens'][1];
		} elseif(isset($exif['LensInfo'][0]) && $exif['LensInfo'][0] !="" ) {
			$lens[0] = $exif['LensInfo'][0];
			$lens[1] = $exif['LensInfo'][1];			
		} else {
			$lens[0] = "";
		}
		/* mise en forme */
			//S'il y a un fichier
		if ( $fich ) {
				// et un XMP mal renseigné
			if( isset($lens[0]) &&  $lens[0] != "") {
				$test= explode(".",$lens[0]);
				if(	intval($test[0]) < 2 || intval($test[0]) > 1100 )	
				{
					$lens[0] = $lens_file[0];
				//	$tagfile = "‾".$tagfile;
				} else {
				// et un XMP bien renseigné
					$lens[0] = $lens_file[0];
					//$tagfile = "*".$tagfile;
				}
				// et pas de xmp
			} else {
					$lens[0] = $lens_file[0];
				//	$tagfile = "¹";
			}
			// S'il n'y a pas de fichier mais un XMP
		} elseif ( isset($lens[0]) && $lens[0] != "" ) 
		{
				$test= explode(".",$lens[0]);
				// mal renseigné
				if(	trim($test[0]) == "0" || intval($test[0])>1100 )
				{			
					$lens[0] = "Manuel (inconnu)";
				//	$tagfile = "*";
				} else {
					//bien renseigné
				//	$tagfile = "*";
				}
		}
		if( @$lens[0] != "" ) {
				$affiche .= $in_titre."Objectif: ".$end_tag.$in_value.$lens[0]." ".$tagfile.$end_tag.$break ;
			$metadata = true;			 
		}
		
		
/* Focale */ 
		if (isset($exif['FocalLength'][0])) {
			$def= split("/", $exif['FocalLength'][0]);
			if (intval($def[1]) == 0 )  $def[1] =1;
			$def2 = intval($def[0])/intval($def[1]);
			if( $def2 == 0 || $def2 >= 1001 ){
				$def2 = "Manuelle (inconnue)";
			} else {
				$def2 = $def2." mm";
			}
			$affiche .= $in_titre."Focale: ".$end_tag.$in_value.$def2." ".$exif['FocalLength'][1].$end_tag.$break ;
			$metadata = true;
		} elseif ( !isset($exif['FNumber'][0]) && !isset($exif['FocalLength'][0])  &&  $metadata == true) {
			$affiche .= $in_titre."Focale: ".$end_tag.$in_value."Manuelle (inconnue)"." ".$exif['FocalLength'][1].$end_tag.$break ;
		}
		
/*diaphragme */
		 if ( $exif['FNumber'][0] && $exif['FocalLength'][0] <= 1002){
			$def= split("/", $exif['FNumber'][0]);
			$def2 = round(intval($def[0])/intval($def[1]),5);
			if( $def2 <0.9 ) $def2 ="inconnu";
			$affiche .= $in_titre."Diaphragme: ".$end_tag.$in_value."f: ".$def2." ".$exif['FNumber'][1].$end_tag.$break ;
			$metadata = true;
		} elseif ($exif['ApertureValue'][0] && $exif['ApertureValue'][0] <= 1002){
			$def= split("/", $exif['ApertureValue'][0]);
			if($def[1] != 0){
			$def2 = round(intval($def[0])/intval($def[1]),5);
			}else{
			$def2 = 0.1;
			}
			if( $def2 <0.9 ) $def2 ="inconnu";
			$affiche .= $in_titre."Diaphragme: ".$end_tag.$in_value."f: ".$def2." ".$exif['ApertureValue'][1].$end_tag.$break ;
			$metadata = true;
		}
 
		
/* Vitesse */

		if ( isset($exif['ExposureTime'][0])){	
			if(	strpos($exif['ExposureTime'][0] ,"/0" ) > 0 ) // Avoid divide by 0
			{
				$exif['ExposureTime'][0] ="Inconnue";
			} else {
				$def= split("/", $exif['ExposureTime'][0]);
				if(round(intval($def[0])/intval($def[1])) >= 1) // pause > 1s
				{				
					$exif['ExposureTime'][0] = 	round(intval($def[0])/intval($def[1]),1);
				} elseif(intval($def[0])%10 == 0) // style 10/1000 au lieu de 1/100
				{
					$exif['ExposureTime'][0] = intval($def[0])/10 . "/" . round(intval($def[1])/10);
				}
			}
			$affiche .= $in_titre."Vitesse: ".$end_tag.$in_value.$exif['ExposureTime'][0]." s. ".$exif['ExposureTime'][1].$end_tag.$break ;
			$metadata = true;
		}
		
/*iso */
		if (isset($exif['ISOSpeedRatings'][0])) {
           	$affiche .=  $in_titre."ISO: ".$end_tag.$in_value.$exif['ISOSpeedRatings'][0]." ".$exif['ISOSpeedRatings'][1].$end_tag.$break ;
			$metadata = true;
		}		
		
/* Compensation d'exposition */
		if ( isset($exif['ExposureBiasValue'][0])){
			if( strpos($exif['ExposureBiasValue'][0],'-' ) === 0) {
				$def = str_replace("-","",$exif['ExposureBiasValue'][0]);
				$def2= explode("/", $def);
				$def3= round(intval($def2[0])/intval($def2[1]),1);
				$affiche .= $mark.$in_titre."Compensation d'exposition: ".$end_tag.$in_value."-".$def3." EV. ".$exif['ExposureBiasValue'][1].$end_tag.$break ;
				$metadata = true;
			} else {
				$def = str_replace("+","",$exif['ExposureBiasValue'][0]);
				$def2= explode("/", $def);
				$def3= round(intval($def2[0])/intval($def2[1]),1);
				if ( $def3 == 1000000) $def3 = "inconnue";
				if(trim($def3) != 0) $def3 = "+ ".$def3;
				$affiche .= $in_titre."Compensation d'exposition: ".$end_tag.$in_value.$def3." EV. ".$exif['ExposureBiasValue'][1].$end_tag.$break ;
				$metadata = true;
			}		
		}
		
/* mode de mesure de lumière */
		if (isset($exif['MeteringMode'][0])){
			switch ($exif['MeteringMode'][0]) {
				case 0: $def = "Inconnu ";
				break;
				case 1: $def = "Moyenne ";
				break;		
				case 2: $def = "Centrale pondérée ";
				break;
				case 3: $def = "Point ";
				break;
				case 4: $def = "Multi points ";
				break;
				case 5: $def = "Multi zones ";
				break;
				case 6: $def = "Partielle ";
				break;
				case 255: $def = "Autre ";
				break;
			}
			$affiche .= $mark.$in_titre."Mesure de lumière: ".$end_tag.$in_value.$def.$exif['MeteringMode'][1].$end_tag.$break ;
			$metadata = true;
		}
		
/* Programme */
		if (isset($exif['ExposureProgram'][0])){		
			switch ($exif['ExposureProgram'][0]) {
				case 0: $def = "Inconnu ";
				break;
				case 1: $def = "Manuel ";
				break;		
				case 2: $def = "Normal ";
				break;
				case 3: $def = "Priorité ouverture ";
				break;
				case 4: $def = "Priorité vitesse ";
				break;
				case 5: $def = "créatif, prof de champ ";
				break;
				case 6: $def = "Action, vitesse ";
				break;
				case 7: $def = "Portrait, fond flou ";
				break;
				case 8: $def = "Paysage, fond net ";
				break;
				default: $def = "Inconnu ";
				}
			$affiche .= $mark.$in_titre."Programme: ".$end_tag.$in_value.$def.$exif['ExposureProgram'][1].$end_tag.$break ;
			$metadata = true;	
		}
		
/* Flash  */ 	
		if (isset($exif['Fired'][0])){		
		    if( strtolower($exif['Fired'][0]) == "true") {
				if( @$exif['RedEyeMode'][0] == "True") $tag=" (Yeux rouges)";
			 	$metadata = true;
				$affiche .= $in_titre."Flash: ".$end_tag.$in_value."oui ".$exif['Flash'][1].$exif['Fired'][1].$tag.$end_tag.$break ;
			} else {
				$affiche .= $in_titre."Flash: ".$end_tag.$in_value."Non ".$exif['Flash'][1].$exif['Fired'][1].$tag.$end_tag.$break ;
			}
		} elseif (isset($exif['Flash'][0])){
			if (intval($exif['Flash'][0])%8 != 0 ) {
				$red= intval($exif['Flash'][0]);
				if( $red >= 1048576 && $red <= 1118481 ) $tag=" (Yeux rouges)";
				$metadata = true;
				$affiche .= $in_titre."Flash: ".$end_tag.$in_value."Oui". $exif['Flash'][1].$exif['Fired'][1].$end_tag.$break ;
			} else {
				$affiche .= $in_titre."Flash: ".$end_tag.$in_value."Non ".$exif['Flash'][1].$exif['Fired'][1].$tag.$end_tag.$break ;
			}		
		}
		
/* Subject distance */
		$tag= "";
		$tagexif ="";
		if ($exif['SubjectDistance'][0]) {
				$def2= explode("/", $exif['SubjectDistance'][0]);
				$def3= round(intval($def2[0])/intval($def2[1]),2);
				if( $def3 > 5000) {
				$affiche .= $in_titre."Mise au point ? :".$end_tag.$in_value." Infini ".$exif['SubjectDistance'][1].$end_tag.$break ;
				}else{
				$affiche .= $in_titre."Mise au point ? : ".$end_tag.$in_value.$def3."m. ".$exif['SubjectDistance'][1].$end_tag.$break ;
				}
		} elseif($exif['ApproximateFocusDistance'][0]) {
				$def2= explode("/", $exif['ApproximateFocusDistance'][0]);
				$def3= round(intval($def2[0])/intval($def2[1]),2);
				if($tagexif =="" && $tag == "") $tagexif ="°";
				if( $def3 > 5000) {
				$affiche .= $in_titre."Mise au point approx? :".$end_tag.$in_value."Infini ".$exif['SubjectDistance'][1].$end_tag.$break ;
				}else{
				$affiche .= $in_titre."Mise au point approx? : ".$end_tag.$in_value.$def3."m. ".$exif['SubjectDistance'][1].$end_tag.$break ;
				}
		}		
		//if ($exif['SubjectDistanceRange']) $affiche .= "Profondeur: ".$exif['SubjectDistanceRange'].$end_tag.$break ;
		//if ($exif['MakerNote']) $affiche .= $exif['MakerNote'].$end_tag.$break ;
$metasdat= str_replace('/components/com_agora',AGORA_PATH,$url_img);
		
		if ( $metadata == true ) {
			$affiche .= $in_warn.$break.$in_titre."°".$end_tag." = Données présentes dans les exifs".$break.$in_titre."*".$end_tag." = Données présentes dans les xmp".$break.$in_titre."¹".$end_tag." = Renseigné manuellement au téléchargement".$break.$end_tag; 
		} else if(file_exists($metasdat.'.dat' )){
			$affiche = file_get_contents($metasdat.'.dat');
		}else{
			$affiche .= $centre."Désolé, AUCUNE DONNÈE MÈTADATA".$break."N'est disponible dans cette photo.".$break.$break."(Ni exif, ni xmp.)".$end_tag ;
		}
		print $affiche;
		print $endbody;
?>

Return to “Highslide JS Usage”