#include <GDIPlus.au3>
Global $sFileJPG, $hImage, $aAll, $sDate, $GDIP_STATUS = 0
Global Const $GDIP_PROPERTYTAGDATETIME = 0x0132 ; Дата и время создания изображения
$sFileJPG = FileOpenDialog('Выберите файл', @ScriptDir & '\', 'Изображения (*)', 1)
If @error Or Not $sFileJPG Then Exit -1
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($sFileJPG)
$aAll = _GDIPlus_ImageGetAllPropertyItems($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
If Not IsArray($aAll) Then Exit -2
; Узнаем дату создания из EXIF-метаданных. Если таковых нет, то FileGetTime()
For $i = 1 To $aAll[0][0]
If $aAll[$i][0] = $GDIP_PROPERTYTAGDATETIME Then
$sDate = DllStructGetData(DllStructCreate('char[' & $aAll[$i][1] & ']', $aAll[$i][3]), 1)
ExitLoop
EndIf
If $i = $aAll[0][0] Then
$aFTime = FileGetTime($sFileJPG)
$sDate = $aFTime[0] & ':' & $aFTime[1] & ':' & $aFTime[2] & ' ' & $aFTime[3] & ':' & $aFTime[4] & ':' & $aFTime[5]
EndIf
Next
ConsoleWrite($sDate & @LF)
#cs ====================================================================================================================
Две функции ниже из библиотеки "GDIP.au3" от Yashied (http://autoit-script.ru/index.php/topic,1384.0.html)
адаптированы под Autoit v3.3.12.0
#ce ====================================================================================================================
Func _GDIPlus_ImageGetAllPropertyItems($hImage)
Local $iI, $iCount, $tBuffer, $pBuffer, $iBuffer, $tPropertyItem, $aSize, $aPropertyItems[1][1], $aResult
Local $tagGDIPPROPERTYITEM = 'uint id;uint length;ushort type;ptr value'
$aSize = _GDIPlus_ImageGetPropertySize($hImage)
If @error Then Return SetError(@error, @extended, -1)
If $GDIP_STATUS Then
$GDIP_ERROR = 1
Return -1
ElseIf $aSize[1] = 0 Then
$GDIP_ERROR = 2
Return -1
EndIf
$iBuffer = $aSize[0]
$tBuffer = DllStructCreate("byte[" & $iBuffer & "]")
$pBuffer = DllStructGetPtr($tBuffer)
$iCount = $aSize[1]
$aResult = DllCall($__g_hGDIPDll, "uint", "GdipGetAllPropertyItems", "hwnd", $hImage, "uint", $iBuffer, "uint", $iCount, "ptr", $pBuffer)
If @error Then Return SetError(@error, @extended, -1)
$GDIP_STATUS = $aResult[0]
If $GDIP_STATUS Then
$GDIP_ERROR = 3
Return -1
EndIf
ReDim $aPropertyItems[$iCount + 1][4]
$aPropertyItems[0][0] = $iCount
For $iI = 1 To $iCount
$tPropertyItem = DllStructCreate($tagGDIPPROPERTYITEM, $pBuffer)
$aPropertyItems[$iI][0] = DllStructGetData($tPropertyItem, "id")
$aPropertyItems[$iI][1] = DllStructGetData($tPropertyItem, "length")
$aPropertyItems[$iI][2] = DllStructGetData($tPropertyItem, "type")
$aPropertyItems[$iI][3] = DllStructGetData($tPropertyItem, "value")
$pBuffer += DllStructGetSize($tPropertyItem)
Next
Return $aPropertyItems
EndFunc ;==>_GDIPlus_ImageGetAllPropertyItems
Func _GDIPlus_ImageGetPropertySize($hImage)
Local $aSize[2], $aResult
$aResult = DllCall($__g_hGDIPDll, "uint", "GdipGetPropertySize", "hwnd", $hImage, "uint*", 0, "uint*", 0)
If @error Then Return SetError(@error, @extended, -1)
$GDIP_STATUS = $aResult[0]
If $GDIP_STATUS Then Return -1
$aSize[0] = $aResult[2]
$aSize[1] = $aResult[3]
Return $aSize
EndFunc ;==>_GDIPlus_ImageGetPropertySize