FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour EXIF
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
EXIF
Posted: Sun Jul 12, 2020 10:03 AM

Hi.

Can I get EXIF metadata from a jpg file ?

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Wed Mar 17, 2021 07:04 AM
Hello Natter,
Have you found a solution yet? If so, can you please post some source code?

After I couldn't find a quick solution with Fivewin, I tried Javascript. There are ready-made libraries (exif-js) here.
Then I tried to call up the webpage with ActiveX. But now I'm stuck.
I haven't found out whether you can read the document object. Can I exchange data between ActiveX and Fivewin
without going through the hard drive?
Best regards,
Otto

https://www.modharbour.club/exif-js-master/example/index.html

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXIF
Posted: Wed Mar 17, 2021 08:13 AM

https://docs.microsoft.com/en-us/window ... tadata-use

Maybe our GDI+ experts can help in reading meta-data from the images.

Regards



G. N. Rao.

Hyderabad, India
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Wed Mar 17, 2021 08:53 AM
Dear Mr. Rao,

Navigating with activeX I get object Htmldocument. Is it possible that we get the content of the Htmldocument.

Best regards,
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: EXIF
Posted: Wed Mar 17, 2021 10:41 AM

Otto, if you got a document from Active X, then work with it through the DOM

PS. And what is the relationship between EXIF and ActiveX ?

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Wed Mar 17, 2021 03:38 PM
Hello Natter,
Thank you. Do you have some code on how to address the DOM object?

The relationship between ActiveX and Exif is that I do not know how to get the information stored in Exif with Fivewin.
But I have a javascript lib that does all I want.
Now it would be great if we could read the DOM object with all the information.
Best regards,
Otto

https://winhotel.space/exif-js-master/example/index.html
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: EXIF
Posted: Wed Mar 17, 2021 04:13 PM

If under FW:

oDk:=oActX:GetProp("Document")
? oDk:getElementsByClassName("MyClass")

or other DOM commands (depending on the task)

Are you going to use the JS library ?

Posts: 244
Joined: Fri Oct 28, 2005 06:29 PM
Re: EXIF
Posted: Wed Mar 17, 2021 08:02 PM
Natter wrote:Hi.

Can I get EXIF metadata from a jpg file ?


Hello!

There is this free comnand line tool EXIFTOOL, take a look in https://exiftool.org/

Greetings
Alejandro Cebolido

Buenos Aires, Argentina
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: EXIF
Posted: Thu Mar 18, 2021 05:48 AM

Thank you, an interesting utility. However, it is with the installation, which is very inconvenient.

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Thu Mar 18, 2021 07:39 AM

Hello Alejandro,
Thank you for pointing to: https://exiftool.org/ .
I will try the software.
Best regards,
Otto

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Thu Mar 18, 2021 07:45 AM

Good morning Natter,
I tried what you suggested but I can't find out the syntax for method and data how to access the object.

oHttp := oActiveX:GetProp( "Document" ) // -> Object Document
cClassName := oHttp:cClassname

? cClassName:innerHTML  / Not working

Can you please help with some more code.

If we can access oHttp from Fivewin, we can use the "DIALOGs" from mod harbour and embed with ActiveX into Fivewin.

Best regards,
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: EXIF
Posted: Thu Mar 18, 2021 09:30 AM
Don't understand what exactly is not working. Did you get the document object ?

Code (fw): Select all Collapse
if oDk:URL=MyUrl
  do while .T.
     if valtype(oDk:body)!="U".and.oDk:body:ReadyState-"complete"
        buf:=oDk:DocumentElement:InnerHTML
        exit
     endif
     multisec(50)
     sysrefresh()
  enddo
endif
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Thu Mar 18, 2021 01:03 PM

Hello Natter,
Many thanks. It works now, technically.
But I think exif.js is not supported by Internet Explorer.
Do you know whether you can set Firefox or Chrome to be opened?

Best regards,
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: EXIF
Posted: Thu Mar 18, 2021 02:03 PM

You think exif.js does not work under IE or you are sure of it.
Can make an HTML file where the library is connected exif.js
Run it from the ActiveX object.
Do page processing.

You can try to open another browser (shellexecute), and the parameter to it is an HTML file

Where to put the received data ?

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: EXIF
Posted: Thu Mar 18, 2021 03:12 PM
Hello Natter,
Thank you.
>You think exif.js does not work under IE or you are sure of it.
Yes, I tried with Internet Explorer and js is not executed.

https://winhotel.space/exif-js-master/e ... index.html




>Can make an HTML file where the library is connected exif.js

Run it from the ActiveX object.
Do page processing.

You can try to open another browser (shellexecute), and the parameter to it is an HTML file

shellexecute(,"open","chrome.exe","https://winhotel.space/exif-js-master/example/index.html")
This is working fine but not with acticeX.
I found this now:
https://stackoverflow.com/questions/353 ... -on-chrome

>Where to put the received data ?
I store the data (buf) with memowrit().

Best regards,
Otto