Hello friends,
How can I get the resolution of a JPG?
I want to remember that I read here that it can be done without opening and reading the photo.
Best regards,
Otto
Otto wrote:Hello friends,
How can I get the resolution of a JPG?
I want to remember that I read here that it can be done without opening and reading the photo.
Best regards,
Otto
JpegDim( cFileJpg ) // --> { nWidth, nHeight }
#include "fivewin.CH"
PROCEDURE MAIN
MsgInfo( hb_valToExp( JpgMetaData("d:\Bilder\NASA\","02-spitzer-smc.jpg") ) )
RETURN
FUNCTION JpgMetaData( cPath, cFilename )
LOCAL aRet := {}
LOCAL nItem, ii,iMax
LOCAL objShell := CreateObject( "Shell.Application" )
LOCAL objFolder
LOCAL objFolderItem
LOCAL cFileInfo
LOCAL cHeaderInfo
LOCAL aItems := {176,178,175,177}
objFolder := objShell:Namespace( cPath )
objFolderItem := objFolder:ParseName( cFilename )
iMax := LEN(aItems)
FOR ii := 1 TO iMax
nItem := aItems[ii]
cFileInfo := objFolder:GetDetailsOf( objFolderItem, nItem )
cHeaderInfo := objFolder:GetDetailsOf( objFolder:Items, nItem )
IF !EMPTY( cHeaderInfo ) .AND. !EMPTY( cFileInfo )
AADD( aRet, { STRZERO( nItem, 3 ), cHeaderInfo, STRTRAN( cFileInfo , "?", "" ) } )
ENDIF
NEXT
objFolderItem := NIL
objFolder := NIL
objShell := NIL
RETURN ACLONE( aRet )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], wmormar and 96 guests