• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Extraer coordenadas GPS de imágenes con PowerShell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
$imagePath = 'C:\Users\juan\Desktop\recono\IMG_20171226_232738.jpg'
$imageProperties = New-Object -TypeName System.Drawing.Bitmap -ArgumentList $imagePath
 
[double]$LatDegrees = (([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 0)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 4)));
[double]$LatMinutes = ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 8)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 12));
[double]$LatSeconds = ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 16)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(2).Value, 20));
[double]$LonDegrees = (([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 0)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 4)));
[double]$LonMinutes = ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 8)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 12));
[double]$LonSeconds = ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 16)) / ([System.BitConverter]::ToInt32( $imageProperties.GetPropertyItem(4).Value, 20));
 
"Latitude: $LatDegrees;$LatMinutes;$LatSeconds"
"Longitude: $LonDegrees;$LonMinutes;$LonSeconds"

Fuente

https://stackoverflow.com/questions/45136895/extracting-gps-numerical-values-from-byte-array-using-powershell

Publicado el día 1 de enero de 2018

CATEGORÍAS

Análisis forense, Gráficos, PowerShell, Seguridad

ETIQUETAS

Drawing, GPS, HTTPS, Jesús Niño Camazón, New-Object, System.Drawing, System.Drawing.Bitmap, value

MÁS

  • Ejercicios de PowerShell: realizar operaciones en un equipo remoto
  • Comparar listas de arrays de caracteres
  • Ejercicios de PowerShell: hacer clic en varias posiciones de la pantalla con PowerShell
  • Adopción de pautas de seguridad informática (Seguridad y alta disponibilidad)
  • Convertir un script de PowerShell en un ejecutable de Windows (convertir un formulario en PowerShell)
  • Learn Linux file permissions (II)