Page 1 of 1

resolution of a JPG

Posted: Fri Dec 02, 2022 3:43 pm
by Otto
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

Re: resolution of a JPG

Posted: Sat Dec 03, 2022 12:17 pm
by Marc Venken

Re: resolution of a JPG

Posted: Sat Dec 03, 2022 8:39 pm
by Otto
Hello Marc,

Thanks. With the help of your link, I remembered that I already solved the problem with modHarbour and a JS LIB.
Thanks again.
Should also work with WEBVIEW2.
Here is the link to the library:
https://github.com/exif-js/exif-js

Best regards,
Otto
PS: That's where forensics starts.

Image

Re: resolution of a JPG

Posted: Sat Dec 03, 2022 8:55 pm
by Otto
Hello Marc,
now I remember.
I wanted to program a working time recording.
A display shows a clock with a QR code that changes every 10 sec.

When an employee scans the QR code and follows the link, the photo is sent to the server and the metadata is read out.

If the picture is older than e.g. 10 sec. then the server reports that the capture was not correct.
This means that the employee must be on-site because he needs the current link and must send immediately.

Best regards,
Otto

Image

Re: resolution of a JPG

Posted: Sat Dec 03, 2022 9:09 pm
by Otto
...
The program is still working:
https://winhotel.space/qrcodejs-master/index-svg.prg

Best regards,
Otto

Re: resolution of a JPG

Posted: Sun Dec 04, 2022 1:15 pm
by nageswaragunupudi
Great !

Re: resolution of a JPG

Posted: Sun Dec 04, 2022 1:15 pm
by nageswaragunupudi
Great !

Re: resolution of a JPG

Posted: Sun Dec 04, 2022 1:48 pm
by Otto
Dear Mr. Rao,
Hearing that from you means a lot to me.
Have a nice Sunday.
Best regards,
Otto

Re: resolution of a JPG

Posted: Sat Dec 31, 2022 10:40 pm
by nageswaragunupudi
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
FWH function

Code: Select all | Expand

JpegDim( cFileJpg ) // --> { nWidth, nHeight }
Source: fwh\source\function\imgtxtio.prg

Ofc, can not provide as much information as the exif.js

Re: resolution of a JPG

Posted: Wed Jan 04, 2023 3:21 am
by Jimmy
hi Otto,

for Desktop App you can get Information of JPG File this Way

Code: Select all | Expand

#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 )