Cherche exemple photo au DMR avec un zoom

gautier
    Cherche exemple photo au DMR avec un zoom
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Je suis en train de faire un petit script Perl (utilisant ExifTool) me permettant de mettre le nom complet d'un objectif dans les données EXIF. Afin de pouvoir déterminer avec quel objectif ont été prises un maximum d'images, j'aimerai quelques exemples de DNG pris avec un Leica DMR + un zoom de la marque, équipé de contacts ROM. Je n'ai aucun zoom dans ma panoplie et j'aimerai voir quelles données sont écrites par le DMR avec ce type d'objectif.

Merci

Pour info, cela permet de passer de cet affichage dans Lightroom

à celui-ci
MITCHEL
    Bonjour
Avatar de l’utilisateur
Membre des Amis
Messages : 5780
Depuis le 18 juin 2011
Conflans st Honorine
J'ai bien un vario elmar rom, mais pas de dos numérique sur le r8 :? je peux le prêter sur Paris au besoin :cool:
Eric Bascoul
Avatar de l’utilisateur
Membre des Amis
Messages : 18883
Depuis le 11 mai 2004
Paris
je n'ai pas de zoom ni de DMR mais je suis sur Paris et je veux bien faire les photos :mrgreen2:
gautier
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Je ne suis pas sur Paris mais je peux toujours essayer de trouver des images sur le net (un JPEG avec toutes les données EXIF d'origine convient aussi).
Eric Bascoul
Avatar de l’utilisateur
Membre des Amis
Messages : 18883
Depuis le 11 mai 2004
Paris
oui, hé bien, justement j'en ai trouvée une tout à l'heure, avec les exifs complets, je te l'envoie par mail :wink:
gautier
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Eric m'a envoyé une image. J'en ai aussi trouvé pas mal sur différents sites, prises avec différents zooms. Mais je n'ai pas pu trouver d'indications sur la focale : les données EXIF manquaient ou bien les objectifs utilisés n'avaient pas de contacts ROM.

Leica prévoit pourtant l'affichage de la focale sur le DMR, en précisant "Dans le cas d’objectifs de zoom dotés d’un équipement ROM, ce réglage s’effectue par paliers. Dans le cas du Vario-Elmar-R 4/80–200, toutefois, jusqu’à 180mm au maximum. Dans deux cas (Apo-Vario-Elmarit-R 2,8/70–180 et Vario-Elmar-R 4,2/105–280), seule la focale de départ est affichée.".

Bizarrement, la notice en anglais dit "On zoom lenses equipped with ROM, the information displayed is the respective shortest and longest focal lengths.".

Par ailleurs, j'ai trouvé ce message qui parle d'une information affichée mais pas stockée pour les zooms.

Exemple de tri dans Lightroom 4 :
gautier
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Pour les plus curieux, voici mon script Perl dans sa version ß.

Si vous voulez l'utiliser, il faut préalablement installer ExifTool. On considère que ce package est disponible dans /usr/bin/lib (ce qui est vrai après l'installation standard sous MacOS X "Lion"). Ensuite, il faut créer un fichier ExifLeicaR.pl contenant le code ci-dessous. Puis l'appeler via le Terminal, en mettant un fichier DNG en paramètre. Attention, si l'objectif est déterminé, le fichier DNG sera modifié. Il est donc conseillé d'en faire une sauvegarde. Notez aussi que le traitement des zooms n'est pas clarifié.

Code : Tout sélectionner
#!/usr/bin/perl -w -I /usr/bin/lib
#------------------------------------------------------------------------------
# File:         ExifLeicaR.pl
#
# Description:  Create the tag 'Lens' with good values for Leica DMR images.
#               The image must contain the focal length (true if the lens is
#               equipped with a ROM).
#
# EXIF Tool (http://owl.phy.queensu.ca/~phil/exiftool/) required !
#
# Revisions:    0.1 - 04/2012 - Gautier
#------------------------------------------------------------------------------

use Image::ExifTool;

#------------------------------------------------------------------------------

#
# ### giveLensName ###
#
# Function using the focal length and the max aperture
# available in the EXIF to give a Leica R lens name
#
# Input 1: focal length (real)
# Input 2: max aperture (real)
#
# Output: list of lens names (empty if undefined, 1 element if determined, 2 or more if several possibilities)
#
# Revisions: 0.1 - 04/2012 - Gautier
#
sub giveLensName($$)
{
    # Inputs
   my $focalLength = $_[0];
   my $maxAperture = $_[1];
   
   # Outputs
   my @lensName = ();
   
   # Local variables
   my $focalLengthReal;
   
   # Code
   
   if (!$focalLength)
   {
      $focalLength = "0.0";
      $focalLengthReal = 0.0;
   }
   else
   {
      if ($focalLength =~ m/^\d+.?\d+$/ )
      {
         $focalLengthReal = $focalLength;
      }
      else
      {
         $focalLengthReal = 0.0;
      }
   }
   
   if ($focalLength == 0.0)
   {
      # Lens without ROM or incomplete EXIF
      
      if (!$maxAperture)
      {
         $maxAperture = 0.0;
      }
      
      # Try to find the right lens
      
      if ($maxAperture == 0)
      {
         # Incomplete EXIF
         # Unable to determine the lens without focal length and max aperture
         
         # TBD : list all possibilities ?
         
      }
      elsif ($maxAperture == 1.4)
      {
         $lensName[0] = "Leica Summilux-R 35 mm f/1,4";
         $lensName[1] = "Leica Summilux-R 50 mm f/1,4";
         $lensName[2] = "Leica Summilux-R 80 mm f/1,4";
      }
      elsif ($maxAperture == 2)
      {
         $lensName[0] = "Leica Summicron-R 35 mm f/2";
         $lensName[1] = "Leica Summicron-R 50 mm f/2";
         $lensName[2] = "Leica Apo-Summicron-R 90 mm f/2";
         $lensName[3] = "Leica Apo-Summicron-R 180 mm f/2";
         $lensName[4] = "Leica Summicron-R 50 mm f/2 + Apo-Extender-R 2x";
         $lensName[5] = "Leica Apo-Summicron-R 90 mm f/2 + Apo-Extender-R 2x";
      }
      elsif ($maxAperture == 2.8)
      {
         $lensName[0] = "Leica Super-Elmarit-R 15 mm f/2,8 Asph.";
         $lensName[1] = "Leica Fisheye-Elmarit-R 16 mm f/2,8";
         $lensName[2] = "Leica Elmarit-R 19 mm f/2,8";
         $lensName[3] = "Leica Elmarit-R 24 mm f/2,8";
         $lensName[4] = "Leica Elmarit-R 28 mm f/2,8";
         $lensName[5] = "Leica Elmarit-R 35 mm f/2,8";
         $lensName[6] = "Leica Macro-Elmarit-R 60 mm f/2,8";
         $lensName[7] = "Leica Apo-Vario-Elmarit-R 70-180 mm f/2,8";
         $lensName[8] = "Leica Elmarit-R 90 mm f/2,8";
         $lensName[9] = "Leica Apo-Macro-Elmarit-R 100 mm f/2,8";
         $lensName[10] = "Leica Elmarit-R 135 mm f/2,8";
         $lensName[11] = "Leica Elmarit-R 180 mm f/2,8";
         $lensName[12] = "Leica Apo-Elmarit-R 180 mm f/2,8";
         $lensName[13] = "Leica Apo-Telyt-R 280 mm f/2,8";
         $lensName[14] = "Leica Apo-Telyt-R 400 mm f/2,8";
         $lensName[15] = "Leica Macro-Elmarit-R 60 mm f/2,8 + Apo-Extender-R 2x";
         $lensName[16] = "Leica Elmarit-R 90 mm f/2,8 + Apo-Extender-R 2x";
         $lensName[17] = "Leica Apo-Macro-Elmarit-R 100 mm f/2,8 + Apo-Extender-R 2x";
         $lensName[18] = "Leica Elmarit-R 135 mm f/2,8 + Apo-Extender-R 2x";
         $lensName[19] = "Leica Apo-Telyt-R 280 mm f/2,8 + Apo-Extender-R 2x";
         $lensName[20] = "Leica Apo-Telyt-R 400 mm f/2,8 + Apo-Extender-R 2x";
      }
      elsif (($maxAperture == 3.4) || ($maxAperture == 3.5))
      {
         $lensName[0] = "Leica Super-Elmar-R 15 mm f/3,5";
         $lensName[1] = "Leica Super-Angulon-R 21 mm f/3,4";
         $lensName[2] = "Leica Apo-Telyt-R 180 mm f/3,4";
         $lensName[3] = "Leica Apo-Telyt-R 180 mm f/3,4 + Apo-Extender-R 2x";
      }
      elsif ($maxAperture == 4)
      {
         $lensName[0] = "Leica Super-Angulon-R 21 mm f/4";
         $lensName[1] = "Leica Vario-Elmar-R 80-200 mm f/4";
         $lensName[2] = "Leica Macro-Elmar-R 100 mm f/4";
         $lensName[3] = "Leica Elmar-R 180 mm f/4";
         $lensName[4] = "Leica Telyt-R 250 mm f/4";
         $lensName[5] = "Leica Apo-Telyt-R 280 mm f/4";
         $lensName[6] = "Leica Apo-Telyt-R 560 mm f/4";
         $lensName[7] = "Leica Macro-Elmar-R 100 mm f/4 + Apo-Extender-R 2x";
         $lensName[8] = "Leica Apo-Telyt-R 400 mm f/4 + Apo-Extender-R 2x";
         $lensName[9] = "Leica Apo-Telyt-R 560 mm f/4 + Apo-Extender-R 2x";
      }
      elsif ($maxAperture == 4.2)
      {
         $lensName[0] = "Leica Vario-Elmar-R 105-280 mm f/4,2";
      }
      elsif ($maxAperture == 4.8)
      {
         $lensName[0] = "Leica Telyt-R 350 mm f/4,8";
      }
      elsif (($maxAperture == 5.5) || ($maxAperture == 5.6))
      {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/5,6";
         $lensName[1] = "Leica Apo-Telyt-R 800 mm f/5,6";
         $lensName[2] = "Leica Apo-Telyt-R 560 mm f/5,6 + Apo-Extender-R 2x";
         $lensName[3] = "Leica Apo-Telyt-R 800 mm f/5,6 + Apo-Extender-R 2x";
      }
      elsif ($maxAperture == 6.3)
      {
        $lensName[0] = "Leica Telyt-S 800 mm f/6,3";
        # But this lens doesn't exist with ROM.
      }
      elsif ($maxAperture == 6.8)
      {
        $lensName[0] = "Leica Telyt-R 400 mm f/6,8";
        $lensName[1] = "Novoflex Telyt-R 560 mm f/6,8";
        # But these lenses don't exist with ROM.
      }
      elsif ($maxAperture == 8)
      {
        $lensName[0] = "Leica MR-Telyt-R 500 mm f/8";
        # But this lens doesn't exist with ROM.
      }
   }
   else
   {
      if (!$maxAperture)
      {
         $maxAperture = 0.0;
      }
      
      # Try to find the right lens
      
      if ($maxAperture == 0)
      {
         # Incomplete EXIF but focal filled, so we can continue
         if ($focalLengthReal == 15)
           {
            $lensName[0] = "Leica Super-Elmarit-R 15 mm f/2,8";
            $lensName[1] = "Leica Super-Elmar-R 15 mm f/3,5";
           }
           elsif ($focalLengthReal == 16)
           {
              $lensName[0] = "Leica Fisheye-Elmarit-R 16 mm f/2,8";
           }
           elsif ($focalLengthReal == 19)
           {
              $lensName[0] = "Leica Elmarit-R 19 mm f/2,8";
           }
           elsif ($focalLengthReal == 21)
           {
              $lensName[0] = "Leica Super-Angulon-R 21 mm f/4";
              $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
           }
           elsif ($focalLengthReal == 24)
           {
              $lensName[0] = "Leica Elmarit-R 24 mm f/2,8";
           }
           elsif ($focalLengthReal == 28)
           {
              $lensName[0] = "Leica Elmarit-R 28 mm f/2,8";
              $lensName[1] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
              $lensName[2] = "Leica Vario-Elmar-R 28-70 mm f/3,5-4,5";
           }
           elsif ($focalLengthReal == 35)
           {
              $lensName[0] = "Leica Summilux-R 35 mm f/1,4";
              $lensName[1] = "Leica Summicron-R 35 mm f/2";
              $lensName[2] = "Leica Elmarit-R 35 mm f/2,8";
              $lensName[3] = "Leica Vario-Elmarit-R 35-70 mm f/2,8 Asph.";
              $lensName[4] = "Leica Vario-Elmar-R 35-70 mm f/3,5";
              $lensName[5] = "Leica Vario-Elmar-R 35-70 mm f/4";
           }
           elsif ($focalLengthReal == 50)
           {
              $lensName[0] = "Leica Summilux-R 50 mm f/1,4";
              $lensName[1] = "Leica Summicron-R 50 mm f/2";
           }
           elsif ($focalLengthReal == 60)
           {
              $lensName[0] = "Leica Macro-Elmarit-R 60 mm f/2,8";
           }
           elsif ($focalLengthReal == 80)
           {
              $lensName[0] = "Leica Summilux-R 80 mm f/1,4";
              $lensName[1] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
              $lensName[2] = "Leica Vario-Elmar-R 80-200 mm f/4";
           }
           elsif ($focalLengthReal == 90)
           {
              $lensName[0] = "Leica Apo-Summicron-R 90 mm f/2";
              $lensName[1] = "Leica Elmarit-R 90 mm f/2,8";
           }
           elsif ($focalLengthReal == 100)
           {
              $lensName[0] = "Leica Apo-Macro-Elmarit-R 100 mm f/2,8";
              $lensName[1] = "Leica Summicron-R 50 mm f/2 + Apo-Extender-R 2x";
           }
           elsif ($focalLengthReal == 135)
           {
              $lensName[0] = "Leica Elmarit-R 135 mm f/2,8";
           }
           elsif ($focalLengthReal == 180)
           {
              $lensName[0] = "Leica Apo-Summicron-R 180 mm f/2";
            $lensName[1] = "Leica Elmarit-R 180 mm f/2,8";
            $lensName[2] = "Leica Apo-Elmarit-R 180 mm f/2,8";
            $lensName[3] = "Leica Apo-Summicron-R 90 mm f/2 + Apo-Extender-R 2x";
            $lensName[4] = "Leica Elmarit-R 90 mm f/2,8 + Apo-Extender-R 2x";
           }
           elsif ($focalLengthReal == 250)
           {
              $lensName[0] = "Leica Telyt-R 250 mm f/4";
           }
           elsif ($focalLengthReal == 280)
           {
              $lensName[0] = "Leica Apo-Telyt-R 280 mm f/2,8";
              $lensName[5] = "Leica Apo-Telyt-R 280 mm f/4";
           }
           elsif ($focalLengthReal == 350)
           {
              $lensName[0] = "Leica Telyt-R 350 mm f/4,8";
           }
           elsif ($focalLengthReal == 400)
           {
              $lensName[0] = "Leica Apo-Telyt-R 400 mm f/2,8";
              $lensName[1] = "Leica Apo-Telyt-R 400 mm f/4";
           }
           elsif ($focalLengthReal == 500)
           {
              $lensName[0] = "Leica MR-Telyt-R 500 mm f/8";
              # But this lens doesn't exist with ROM.
           }
           elsif ($focalLengthReal == 560)
           {
              $lensName[0] = "Leica Apo-Telyt-R 560 mm f/5,6";
           }
           elsif ($focalLengthReal == 800)
           {
              $lensName[0] = "Leica Apo-Telyt-R 800 mm f/5,6";
           }
           else
           {
              # Certainly a zoom with an intermediate focal stored
              if (($focalLengthReal >= 21) && ($focalLengthReal < 28))
              {
                 $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
              }
              elsif (($focalLengthReal >= 28) && ($focalLengthReal < 35))
              {
                 $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
                 $lensName[1] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
                 $lensName[2] = "Leica Vario-Elmar-R 28-70 mm f/3,5-4,5";
              }
              elsif (($focalLengthReal >= 35) && ($focalLengthReal < 70))
              {
                 $lensName[0] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
                 $lensName[1] = "Leica Vario-Elmar-R 28-70 mm f/3,5-4,5";
                 $lensName[2] = "Leica Vario-Elmarit-R 35-70 mm f/2,8 Asph.";
                 $lensName[3] = "Leica Vario-Elmar-R 35-70 mm f/3,5";
                 $lensName[4] = "Leica Vario-Elmar-R 35-70 mm f/4";
              }
              elsif (($focalLengthReal >= 70) && ($focalLengthReal < 80))
              {
                 $lensName[0] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
              }
              elsif (($focalLengthReal >= 80) && ($focalLengthReal <= 90))
              {
                 $lensName[0] = "Leica Vario-Elmarit-R 28-90 mm f/2,8-4,5";
                 $lensName[1] = "Leica Vario-Elmar-R 80-200 mm f/4";
              }
              elsif (($focalLengthReal > 90) && ($focalLengthReal < 105))
              {
                 $lensName[0] = "Leica Vario-Elmar-R 80-200 mm f/4";
              }
              elsif (($focalLengthReal >= 105) && ($focalLengthReal <= 200))
              {
                 $lensName[0] = "Leica Vario-Elmar-R 80-200 mm f/4";
                 $lensName[1] = "Leica Vario-Elmar-R 105-280 mm f/4,2";
              }
              elsif (($focalLengthReal >= 105) && ($focalLengthReal <= 280))
              {
                 $lensName[0] = "Leica Vario-Elmar-R 105-280 mm f/4,2";
              }
              else
              {
                 # TBD : list all possibilities ?
              }
           }   
      }
      elsif ($maxAperture == 1.4)
      {
        if ($focalLengthReal == 35)
        {
         $lensName[0] = "Leica Summilux-R 35 mm f/1,4";
        }
        elsif ($focalLengthReal == 50)
        {
         $lensName[0] = "Leica Summilux-R 50 mm f/1,4";
        }
        elsif ($focalLengthReal == 80)
        {
         $lensName[0] = "Leica Summilux-R 80 mm f/1,4";
        }
        else
        {
         # Undefined
        }
      }
      elsif ($maxAperture == 2)
      {
        if ($focalLengthReal == 35)
        {
         $lensName[0] = "Leica Summicron-R 35 mm f/2";
        }
        elsif ($focalLengthReal == 50)
        {
         $lensName[0] = "Leica Summicron-R 50 mm f/2";
        }
        elsif ($focalLengthReal == 90)
        {
         # It can't be a Summicron-R because there is no no-APO one with ROM
         $lensName[0] = "Leica Apo-Summicron-R 90 mm f/2";
        }
        elsif ($focalLengthReal == 100)
        {
         $lensName[0] = "Leica Summicron-R 50 mm f/2 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 180)
        {
         $lensName[0] = "Leica Apo-Summicron-R 180 mm f/2";
         $lensName[2] = "Leica Apo-Summicron-R 90 mm f/2 + Apo-Extender-R 2x";
        }
        else
        {
         # Undefined
        }
      }
      elsif ($maxAperture == 2.8)
      {
        if ($focalLengthReal == 15)
        {
         $lensName[0] = "Leica Super-Elmarit-R 15 mm f/2,8 Asph.";
        }
        elsif ($focalLengthReal == 16)
        {
         $lensName[0] = "Leica Fisheye-Elmarit-R 16 mm f/2,8";
        }
        elsif ($focalLengthReal == 19)
        {
         $lensName[0] = "Leica Elmarit-R 19 mm f/2,8";
        }
        elsif ($focalLengthReal == 24)
        {
         $lensName[0] = "Leica Elmarit-R 24 mm f/2,8";
        }
        elsif ($focalLengthReal == 28)
        {
         # It can't be a PC-Super-Angulon-R because there is no PC with ROM
         $lensName[0] = "Leica Elmarit-R 28 mm f/2,8";
        }
        elsif ($focalLengthReal == 35)
        {
         $lensName[0] = "Leica Elmarit-R 35 mm f/2,8";
        }
        elsif ($focalLengthReal == 60)
        {
         $lensName[0] = "Leica Macro-Elmarit-R 60 mm f/2,8";
        }
        elsif ($focalLengthReal == 70)
        {
         # The focal stored for the Apo-Vario-Elmarit-R 70-180 mm f/2,8 is always the shortest
         $lensName[0] = "Leica Apo-Vario-Elmarit-R 70-180 mm f/2,8";
        }
        elsif ($focalLengthReal == 90)
        {
         $lensName[0] = "Leica Elmarit-R 90 mm f/2,8";
        }
        elsif ($focalLengthReal == 100)
        {
         $lensName[0] = "Leica Apo-Macro-Elmarit-R 100 mm f/2,8";
        }
        elsif ($focalLengthReal == 120)
        {
         $lensName[0] = "Leica Macro-Elmarit-R 60 mm f/2,8 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 135)
        {
         $lensName[0] = "Leica Elmarit-R 135 mm f/2,8";
        }
        elsif ($focalLengthReal == 180)
        {
         $lensName[0] = "Leica Elmarit-R 180 mm f/2,8";
         $lensName[1] = "Leica Apo-Elmarit-R 180 mm f/2,8";
         $lensName[2] = "Leica Elmarit-R 90 mm f/2,8 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 200)
        {
         $lensName[0] = "Leica Apo-Macro-Elmarit-R 100 mm f/2,8 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 270)
        {
         $lensName[0] = "Leica Elmarit-R 135 mm f/2,8 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 280)
        {
         $lensName[0] = "Leica Apo-Telyt-R 280 mm f/2,8";
        }
        elsif ($focalLengthReal == 400)
        {
         $lensName[0] = "Leica Apo-Telyt-R 400 mm f/2,8";
        }
        elsif ($focalLengthReal == 560)
        {
         $lensName[0] = "Leica Apo-Telyt-R 280 mm f/2,8 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 800)
        {
         $lensName[0] = "Leica Apo-Telyt-R 400 mm f/2,8 + Apo-Extender-R 2x";
        }
        else
        {
          # Certainly a zoom with an intermediate focal stored
           if (($focalLengthReal > 35) && ($focalLengthReal < 70))
           {
              $lensName[0] = "Leica Vario-Elmarit-R 35-70 mm f/2,8 Asph.";
           }
           elsif (($focalLengthReal > 70) && ($focalLengthReal < 180))
           {
              $lensName[0] = "Leica Apo-Vario-Elmarit-R 70-180 mm f/2,8";
           }
           else
           {
              # Undefined
         }
        }
      }
      elsif ($maxAperture == 3.4)
      {
        if ($focalLengthReal == 15)
        {
         # The f/3,5 Super-Elmar seems to record f/3,4 in EXIF
         $lensName[0] = "Leica Super-Elmar-R 15 mm f/3,5";
        }
        elsif ($focalLengthReal == 21)
        {
         $lensName[0] = "Leica Super-Angulon-R 21 mm f/3,4";
        }
        elsif ($focalLengthReal == 180)
        {
         $lensName[0] = "Leica Apo-Telyt-R 180 mm f/3,4";
        }
        elsif ($focalLengthReal == 360)
        {
         $lensName[0] = "Leica Apo-Telyt-R 180 mm f/3,4 + Apo-Extender-R 2x";
        }
        else
        {
          # Undefined
        }
      }
      elsif ($maxAperture == 3.5)
      {
        if ($focalLengthReal == 15)
        {
         $lensName[0] = "Leica Super-Elmar-R 15 mm f/3,5";
        }
        else
        {
          # Certainly a zoom
           if (($focalLengthReal >= 21) && ($focalLengthReal < 28))
           {
              $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
           }
           elsif (($focalLengthReal >= 28) && ($focalLengthReal < 35))
           {
              $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
              $lensName[1] = "Leica Vario-Elmar-R 28-70 mm f/3,5-4,5";
           }
           elsif ($focalLengthReal == 35)
           {
              $lensName[0] = "Leica Vario-Elmar-R 21-35 mm f/3,5-4";
              $lensName[1] = "Leica Vario-Elmar-R 28-70 mm f/3,5-4,5";
              $lensName[2] = "Leica Vario-Elmar-R 35-70 mm f/3,5";
           }
           elsif (($focalLengthReal > 35) && ($focalLengthReal <= 70))
           {
              $lensName[1] = "Leica Vario-Elmar-R 35-70 mm f/3,5";
           }
           else
           {   
              # Undefined
           }
        }
      }
      elsif ($maxAperture == 4)
      {
        if ($focalLengthReal == 21)
        {
         $lensName[0] = "Leica Super-Angulon-R 21 mm f/4";
        }
        elsif ($focalLengthReal == 35)
        {
         $lensName[0] = "Leica PA-Curtagon-R 35 mm f/4";
         $lensName[1] = "Leica Vario-Elmar-R 35-70 mm f/4";
        }
        elsif ($focalLengthReal == 80)
        {
         $lensName[0] = "Leica Vario-Elmar-R 80-200 mm f/4";
        }
        elsif ($focalLengthReal == 100)
        {
         $lensName[0] = "Leica Macro-Elmar-R 100 mm f/4";
         $lensName[1] = "Leica Vario-Elmar-R 80-200 mm f/4";
        }
        elsif ($focalLengthReal == 180)
        {
         $lensName[0] = "Leica Elmar-R 180 mm f/4";
         $lensName[1] = "Leica Vario-Elmar-R 80-200 mm f/4";
        }
        elsif ($focalLengthReal == 200)
        {
         $lensName[0] = "Leica Macro-Elmar-R 100 mm f/4 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 250)
        {
         $lensName[0] = "Leica Telyt-R 250 mm f/4";
        }
        elsif ($focalLengthReal == 280)
        {
         $lensName[0] = "Leica Apo-Telyt-R 280 mm f/4";
        }
        elsif ($focalLengthReal == 400)
        {
         $lensName[0] = "Leica Apo-Telyt-R 400 mm f/4";
        }
        elsif ($focalLengthReal == 560)
        {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/4";
        }
        elsif ($focalLengthReal == 800)
        {
         $lensName[0] = "Leica Apo-Telyt-R 400 mm f/4 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 1120)
        {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/4 + Apo-Extender-R 2x";
        }
        else
        {
           # Certainly a zoom with an intermediate focal stored
           if (($focalLengthReal > 35) && ($focalLengthReal < 70))
           {
              $lensName[0] = "Leica Vario-Elmar-R 35-70 mm f/4";
           }
           elsif (($focalLengthReal > 80) && ($focalLengthReal < 200))
           {
              $lensName[0] = "Leica Vario-Elmar-R 80-200 mm f/4";
           }
           else
           {
              # Undefined
         }
        }
      }
      elsif ($maxAperture == 4.2)
      {
        $lensName[0] = "Leica Vario-Elmar-R 105-280 mm f/4,2";
      }
      elsif ($maxAperture == 4.8)
      {
        $lensName[0] = "Leica Telyt-R 350 mm f/4,8";
      }
      elsif (($maxAperture == 5.5) || ($maxAperture == 5.6))
      {
        if ($focalLengthReal == 560)
        {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/5,6";
        }
        elsif ($focalLengthReal == 800)
        {
         $lensName[0] = "Leica Apo-Telyt-R 800 mm f/5,6";
        }
        elsif ($focalLengthReal == 1120)
        {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/5,6 + Apo-Extender-R 2x";
        }
        elsif ($focalLengthReal == 1600)
        {
         $lensName[0] = "Leica Apo-Telyt-R 800 mm f/5,6 + Apo-Extender-R 2x";
        }
        else
        {
         $lensName[0] = "Leica Apo-Telyt-R 560 mm f/5,6";
         $lensName[1] = "Leica Apo-Telyt-R 800 mm f/5,6";
         $lensName[2] = "Leica Apo-Telyt-R 560 mm f/5,6 + Apo-Extender-R 2x";
         $lensName[3] = "Leica Apo-Telyt-R 800 mm f/5,6 + Apo-Extender-R 2x";
        }
      }
      elsif ($maxAperture == 6.3)
      {
        $lensName[0] = "Leica Telyt-S 800 mm f/6,3";
        # But this lens doesn't exist with ROM.
      }
      elsif ($maxAperture == 6.8)
      {
        if ($focalLengthReal == 400)
        {
         $lensName[0] = "Leica Telyt-R 400 mm f/6,8";
         # But this lens doesn't exist with ROM.
        }
        elsif ($focalLengthReal == 560)
        {
         $lensName[0] = "Novoflex Telyt-R 560 mm f/6,8";
         # But this lens doesn't exist with ROM.
        }
      }
      elsif ($maxAperture == 8)
      {
        $lensName[0] = "Leica MR-Telyt-R 500 mm f/8";
        # But this lens doesn't exist with ROM.
      }
   }

   return @lensName;
}

#------------------------------------------------------------------------------

#
# ### main ###
#
# ExifLeicaR - Test's program
#
# Usage: ExifLeicaR.pl <image name>
#
# Revisions: 0.1 - 04/2012 - Gautier
#

# A photo must be given as 1st parameter
my $photo = shift or die "Merci d'indiquer un nom de fichier image / Thanks to give an image file";

# Read EXIF from the photo
my $exifTool = new Image::ExifTool;
my $info = $exifTool->ImageInfo($photo);

# Check that the photo has been taken using a Leica Digital-Modul-R
my $camera = $exifTool->GetValue('UniqueCameraModel');
if (!$camera)
{
   $camera = "?";
}
my $model = $exifTool->GetValue('Model');
if (!$model)
{
   $model = "?";
}

if (($camera eq "Leica DMR") || ($model =~ /Digital Back DMR/) || ($model =~ /Leica DMR/))
{
  # The image is a DMR one, we can create/modify the tag Lens

  # Read the focal length
  $focalLength = $exifTool->GetValue('FocalLength');
  if (!$focalLength)
  {
   $focalLength = 0.0;
  }
  my @focalLengthArray = split(' ',  $focalLength);
  my $focalLengthReal = $focalLengthArray[0];
 
  print "Longueur focale / Focal length = $focalLengthReal mm\n";
      
  # Read the MaxApertureValue tag (to determine the type of lens)
  $maxAperture = $exifTool->GetValue('MaxApertureValue');
  if (!$maxAperture)
  {
   $maxAperture = 0.0;
  }
  print "Ouverture maximale / Max aperture = f/$maxAperture\n";
      
  # Try to find the right lens
  my @tabLenses = ();
  #print "giveLensName($focalLengthReal, $maxAperture)\n";
  @tabLenses = &giveLensName($focalLengthReal, $maxAperture);
  if (exists($tabLenses[0]) && !exists($tabLenses[1]))
  {
     $lensName = $tabLenses[0];
     print "Objectif determiné / Lens defines [$lensName]\n";
   $exifTool->SetNewValue(Lens => $lensName);
      
   print "Mise à jour / Update \"$photo\"\n";
     $exifTool->WriteInfo($photo);
  }
  else
  {
     if (!exists($tabLenses[0]))
   {
           print "Objectif indeterminé / Lens undefined [$focalLengthReal mm @ f/$maxAperture]\n";
   }
   else
   {
      print "Plusieurs objectifs possibles / Several possible lenses [$focalLengthReal mm @ f/$maxAperture]\n";
         
      foreach my $element (@tabLenses)
      {
            print " - $element\n";
      }
      
      # This list should be compared to a personal list of lenses. If there is only one lens in the two lists, we can conclude.
      # If not, we have to chose manually the right lens.
      
      # TBD
   }
  }

}
else
{
  # The script is stopped because the image is not a DMR one
  print "La photo \"$photo\" n'a pas été prise avec un Leica DMR (ou données manquantes) [$camera / $model].\n";
  print "The photo \"$photo\" has not been taken with a Leica DMR (or lack of data) [$camera / $model].\n";
}


Exemple d'appel :

./ExifLeicaR.pl Exemples/L1041528.DNG
Longueur focale / Focal length = 560.0 mm
Ouverture maximale / Max aperture = f/5.5
Objectif determiné / Lens defines [Leica Apo-Telyt-R 560 mm f/5,6]
Mise à jour / Update "Exemples/L1041528.DNG"

Dans Lightroom, on peut demander à ce que les métadonnées soient relues depuis le fichier. L'affichage devient alors pour ce fichier L1041528.DNG :


Ca ne sert pas à grand chose, mais mes Leica R se démarquent moins des autres :wink:
Paps
Messages : 7
Depuis le 13 oct 2009
Paris
Bonjour Gautier

J'ai tout ce qu'il faut pour ton test, à savoir un R9 + DMR avec un vario-elmar 1:4 35-70 avec roms.

Je ne suis pas spécialiste des EXIF et comme les DNG originaux pèsent dans les 20 Mo, je ne peux sans doute pas te les envoyer en l'état. Dis moi quel logiciel et quelle procédure suivre pour les convertir / comprimer sans pertes d'informations dans l'Exif.

Donne moi aussi l'adresse mail où te les envoyer.

Cordialement.

Paps
Collectionneur d'appareils, essentiellement Reflex, ayant marqué la jeune "histoire" du numérique.
gautier
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Paps a écrit :
J'ai tout ce qu'il faut pour ton test, à savoir un R9 + DMR avec un vario-elmar 1:4 35-70 avec roms.
Merci :) Il semble que le DMR affiche les informations mais ne les enregistre pas, c'est ce que j'ai compris après avoir discuté du même sujet sur ce fil (LUF). Mais je reste preneur d'images complètes faites avec votre Vario-Elmar. Merci de les expédier à docs@summilux.net Ça devrait passer. En cas d'échec, vous pouvez passer par ce service.
Paps
Messages : 7
Depuis le 13 oct 2009
Paris
Gautier,

Je viens d'envoyer 2 fichiers DNG à des focales différentes via le service en question.

Merci par avance de me confirmer la bonne réception.

Cordialement.

Paps
Collectionneur d'appareils, essentiellement Reflex, ayant marqué la jeune "histoire" du numérique.
gautier
Avatar de l’utilisateur
Administrateur
Messages : 14716
Depuis le 21 mai 2003
Toulouse
Pour information, il n'est pas possible de déterminer l'ensemble des objectifs Leica R. Mais ça marche pas mal avec les miens et je passe maintenant systématiquement un script sur mes images. Dans Lightroom, j'ai pu mettre un nom d'objectif sur la quasi-totalité de mon catalogue (j'ai par exemple un Summicron 90 sans contacts mais un script inscrit quand même son nom dans les données EXIF - il faut bien sûr que je sache que cet objectif a été utilisé).



Le principe s'applique aussi aux images prises avec un autre boîtier.


Retourner vers Leica R : objectifs

Qui est en ligne

Utilisateurs parcourant cette section : Aucun utilisateur enregistré et 5 invités