resolution of a JPG

Post Reply
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

resolution of a JPG

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Marc Venken
Posts: 1482
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: resolution of a JPG

Post by Marc Venken »

Marc Venken
Using: FWH 23.08 with Harbour
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: resolution of a JPG

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: resolution of a JPG

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: resolution of a JPG

Post by Otto »

...
The program is still working:
https://winhotel.space/qrcodejs-master/index-svg.prg

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10701
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 3 times
Contact:

Re: resolution of a JPG

Post by nageswaragunupudi »

Great !
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10701
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 3 times
Contact:

Re: resolution of a JPG

Post by nageswaragunupudi »

Great !
Regards

G. N. Rao.
Hyderabad, India
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: resolution of a JPG

Post by Otto »

Dear Mr. Rao,
Hearing that from you means a lot to me.
Have a nice Sunday.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10701
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 3 times
Contact:

Re: resolution of a JPG

Post 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
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: resolution of a JPG

Post 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 )
greeting,
Jimmy
Post Reply