resolution of a JPG

resolution of a JPG

Postby Otto » Fri Dec 02, 2022 3:43 pm

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
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: resolution of a JPG

Postby Marc Venken » Sat Dec 03, 2022 12:17 pm

Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: resolution of a JPG

Postby Otto » Sat Dec 03, 2022 8:39 pm

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: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: resolution of a JPG

Postby Otto » Sat Dec 03, 2022 8:55 pm

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: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: resolution of a JPG

Postby Otto » Sat Dec 03, 2022 9:09 pm

...
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
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: resolution of a JPG

Postby nageswaragunupudi » Sun Dec 04, 2022 1:15 pm

Great !
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resolution of a JPG

Postby nageswaragunupudi » Sun Dec 04, 2022 1:15 pm

Great !
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resolution of a JPG

Postby Otto » Sun Dec 04, 2022 1:48 pm

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
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: resolution of a JPG

Postby nageswaragunupudi » Sat Dec 31, 2022 10:40 pm

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 view
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
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resolution of a JPG

Postby Jimmy » Wed Jan 04, 2023 3:21 am

hi Otto,

for Desktop App you can get Information of JPG File this Way
Code: Select all  Expand view
#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
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests