Set "Date Taken" in .jpg files

Started by mueer01, July 03, 2015, 05:42:55 AM

Previous topic - Next topic

mueer01

Hello,

I scanned old photos, and now I want to set the "Date taken" attribute in the .jpg files.
Already installed DSOFILE component and run the example for .doc files, found here in the forum. But unfortunately this does not work for .jpg files.

Does anyone have an example to set the "Date taken" attribute?

Regards,
Erhard

td

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mueer01

EXACTLY what I was looking for!
Many Thanks.

mueer01

Hi td,

one more question/problem. I tried these simple script:

---
AddExtender("WWPSU45Ix86.dll")
PSIndex = psuOpenPS("C:\tmp\pic1.jpg", 0)

DateTaken = psuGetPropertyValue(PSIndex, "System.Photo.DateTaken", 0)
message("DateTaken", DateTaken)

ret = psuSetPropertyValue(PSIndex, "System.Photo.DateTaken", "01.02.1993 15:00")
message("ret", ret)

psuClosePS(PSIndex)
---

The function psuGetPropertyValue() works fine. The date is returned.
But function psuSetPropertyValue() returns an ERROR popup with "...Access denied due to insufficient rights."

The file has "Full Control to Everyone", and I can modify DateTaken manually in the File Properties, of course.
I also tried it with different pics in different folders.

Regards,
Erhard


   


td

Perhaps review the extenders documentation and try the correct gps-flags parameter value.  The psuOpenPS function's documentation states:

"(i) gps-flags:  [Get Property Store Flags]  One or more optional flag bits in a mask value that controls how the property store is opened for the file.  A value of 0 [zero] opens in read-only mode.  A value of 2 [two] opens in read-write mode."

and the extender's associated Tech Support article states:

"Call psuSetPropertyValue() to modify the value of a writeable property in the property store. This function always fails if the open-mode is read-only, and also fails if the property itself is read-only even when the open mode is read-write."

If that doesn't help then the extender's author may have additional advice.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade