Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date/Time Metadata incorrrect #507

Closed
grainsoflight opened this issue Jan 7, 2024 · 58 comments
Closed

Date/Time Metadata incorrrect #507

grainsoflight opened this issue Jan 7, 2024 · 58 comments

Comments

@grainsoflight
Copy link

Im running into an issue where the "Date Taken" information seems to be displaying the date the image was imported into damselfly. I am editing the capture date/time metadata in lightroom, though when I write it to the file, it does not change in damselfly. Other metadata, such as tags, do change when updated. Additionally, the date shown in damselfly does not seem to match any data in the metadata, as both the existing capture and digitization dates were in 2022 and the changed date is 1988, though damselfly has always shown 2023. No date ending in 2023 has ever existed in the file metadata.

@Webreaper
Copy link
Owner

Can you please try the dev tag of the docker image (webreaper/damselfly:dev) and refresh the metadata for the image, and let me know if that fixes it. If not, please can you attach a sample image so I can debug?

@grainsoflight
Copy link
Author

grainsoflight commented Jan 7, 2024 via email

@grainsoflight
Copy link
Author

grainsoflight commented Jan 8, 2024 via email

@grainsoflight
Copy link
Author

grainsoflight commented Jan 8, 2024 via email

@Webreaper
Copy link
Owner

Webreaper commented Jan 8, 2024 via email

@grainsoflight
Copy link
Author

grainsoflight commented Jan 8, 2024 via email

@Webreaper
Copy link
Owner

Don't see any attachments with that name - are you sure you actually attached it or emailed it to me?

@grainsoflight
Copy link
Author

Github removed it for some reason when I emailed it, ill upload directly
fastfoto_0804291

@Webreaper
Copy link
Owner

Thanks

@grainsoflight
Copy link
Author

In the mean time, could you let me know what metadata fields it should be pulling Date and Caption/Description from? I have a lot of photos Im archiving and am kinda in a holding pattern until I can figure out exactly where this metadata should go, especially as there are numerous places in EXIF/IPTC that captions/descriptions in dates can go. I tried all the fields I could thing of and it didnt work, so Im sure an actual issue exits and it's not just error, but if I knew the exact fields they SHOULD be I could feel comfortable moving forward with my data entry in lightroom while you look at this without having to worry that once a solution is found I would have to go back and redo everything.

@Webreaper
Copy link
Owner

Webreaper commented Jan 10, 2024

So looking at this image, I'm seeing a few things:

  1. It's a PNG file. Is this intentional? Any reason why you're not scanning to JPEG? I'll have to look and see what metadata I'm pulling for PNG files, as it may not be the same as exif info for JPEGs.
  2. Looking in Exiftool, the creation date is 1988 - is that the date you're expecting?
  3. Which exif field are you expecting to pull the caption from (or what is the caption you're expecting)?

Damselfly pulls in DateTimeDigitized tag for date taken. If that's not available, I use DateTImeOriginal. And as a last resort, I use the DateTime tag.

Captions and descriptions come from the IPTC directory tags Caption or the Exif tag ImageDescription.

I haven't debugged this with your image yet, though.

@grainsoflight
Copy link
Author

grainsoflight commented Jan 10, 2024 via email

@grainsoflight
Copy link
Author

grainsoflight commented Jan 10, 2024 via email

@Webreaper
Copy link
Owner

Okay, so it looks like the issue is that all the data you're populating is going into the XMP directory, which I wasn't really parsing much out of before (probably because most people use JPGs, and all the metadata for those usually goes into IPTC or EXIF directories.

I've just pushed a change to extract the capture date from the exif:DateTimeOriginal tag in the Photoshop XMP directory, which works for me. Once it's finished building in about 30 mins, can you re-pull webreaper/damselfly:dev and give that a go.

I couldn't see any obvious caption/description data in that photo's Exif info, so it's hard to know which Photoshop XML tag to pull them from. If you can send me a sample image with the caption set to "Here is the Caption" and the description set to "Here is the description" I can add support for those too.

When I get more time, I'll also see about pulling out the copyright info from the XMP tags too. But hopefully this will get you going.

@grainsoflight
Copy link
Author

Damselfly no longer loads from the dev branch

`/app/dl: cannot open shared object file: No such file or directory
/app/libdl: cannot open shared object file: No such file or directory

at Emgu.Util.Toolbox.Dlopen(String dllname, Int32 mode)
at Emgu.Util.Toolbox.LoadLibrary(String dllname)
at Emgu.CV.CvInvoke.LoadUnmanagedModules(String loadDirectory, String[] unmanagedModules)
at Emgu.CV.CvInvoke.DefaultLoadUnmanagedModules(String[] modules)
at Emgu.CV.CvInvoke..cctor()
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.cveStringCreateFromStr(IntPtr c)
at Emgu.CV.CvString..ctor(String s)
at Emgu.CV.CascadeClassifier..ctor(String fileName)
at Damselfly.ML.Face.Emgu.EmguFaceService.InitialiseClassifiers()
[15:13:58.021-0001-ERR] Unable to initialize Emgu face detection: System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/app/dl.so: cannot open shared object file: No such file or directory
/app/libdl.so: cannot open shared object file: No such file or directory
/app/dl: cannot open shared object file: No such file or directory
/app/libdl: cannot open shared object file: No such file or directory

at Emgu.Util.Toolbox.Dlopen(String dllname, Int32 mode)
at Emgu.Util.Toolbox.LoadLibrary(String dllname)
at Emgu.CV.CvInvoke.LoadUnmanagedModules(String loadDirectory, String[] unmanagedModules)
at Emgu.CV.CvInvoke.DefaultLoadUnmanagedModules(String[] modules)
at Emgu.CV.CvInvoke..cctor()
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.cveStringCreateFromStr(IntPtr c)
at Emgu.CV.CvString..ctor(String s)
at Emgu.CV.CascadeClassifier..ctor(String fileName)
at Damselfly.ML.Face.Emgu.EmguFaceService.InitialiseClassifiers()
[15:13:58.021-0001-ERR] Unable to initialize Emgu face detection: System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/app/dl.so: cannot open shared object file: No such file or directory
/app/libdl.so: cannot open shared object file: No such file or directory
/app/dl: cannot open shared object file: No such file or directory
/app/libdl: cannot open shared object file: No such file or directory

at Emgu.Util.Toolbox.Dlopen(String dllname, Int32 mode)
at Emgu.Util.Toolbox.LoadLibrary(String dllname)
at Emgu.CV.CvInvoke.LoadUnmanagedModules(String loadDirectory, String[] unmanagedModules)
at Emgu.CV.CvInvoke.DefaultLoadUnmanagedModules(String[] modules)
at Emgu.CV.CvInvoke..cctor()
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.cveStringCreateFromStr(IntPtr c)
at Emgu.CV.CvString..ctor(String s)
at Emgu.CV.CascadeClassifier..ctor(String fileName)
at Damselfly.ML.Face.Emgu.EmguFaceService.InitialiseClassifiers()
[15:13:58.021-0001-ERR] Unable to initialize Emgu face detection: System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/app/dl.so: cannot open shared object file: No such file or directory
/app/libdl.so: cannot open shared object file: No such file or directory
/app/dl: cannot open shared object file: No such file or directory
/app/libdl: cannot open shared object file: No such file or directory

at Emgu.Util.Toolbox.Dlopen(String dllname, Int32 mode)
at Emgu.Util.Toolbox.LoadLibrary(String dllname)
at Emgu.CV.CvInvoke.LoadUnmanagedModules(String loadDirectory, String[] unmanagedModules)
at Emgu.CV.CvInvoke.DefaultLoadUnmanagedModules(String[] modules)
at Emgu.CV.CvInvoke..cctor()
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.cveStringCreateFromStr(IntPtr c)
at Emgu.CV.CvString..ctor(String s)
at Emgu.CV.CascadeClassifier..ctor(String fileName)
at Damselfly.ML.Face.Emgu.EmguFaceService.InitialiseClassifiers()
[15:13:58.035-0001-INF] Executing: convert --version
[15:13:58.095-0001-INF] ImageMagick found: vVersion: ImageMagick 7.1.1-26 Q16-HDRI x86_64 21914 https://imagemagick.org
[15:13:58.104-0001-INF] Watermark font installed: /app/wwwroot/fonts/arial.ttf
[15:13:58.105-0001-INF] Created downloads folder: /app/wwwroot/downloads
[15:13:58.106-0001-INF] Task scheduler started.
[15:13:58.107-0001-INF] Registered job processing source: ThumbnailService
[15:13:58.108-0001-INF] Executing: exiftool -ver
[15:13:58.161-0001-INF] ExifTool Version: v12.67

[15:13:58.173-0001-INF] Registered job processing source: ExifService
[15:13:58.175-0001-INF] Warming up image cache with up to 2000 most recent images.
[15:13:58.828-0001-INF] Enriched and cached 2000 in 643ms
[15:13:58.828-0001-INF] Image Cache primed with 2000 images.
[15:13:58.829-0001-INF] Started Work service thread.
[15:13:58.830-0001-INF] Transaction limits set to 30/min, and 30000/month
[15:13:58.841-0001-INF] Monthly trans count initialised at 0 for AzureFace
[15:13:58.854-0001-INF] Registered job processing source: MetaDataService
[15:13:58.855-0001-INF] Registered job processing source: IndexingService
[15:13:58.861-0001-INF] Registered job processing source: ImageRecognitionService
[15:13:58.868-0001-INF] Adding scheduled task: CleanupThumbs every 1 week
[15:13:58.870-0001-INF] Adding scheduled task: CleanupDownloads every 6 hours
[15:13:58.870-0001-INF] Adding scheduled task: CleanupKeywordOps every 12 hours
[15:13:58.870-0001-INF] Adding scheduled task: DumpPerformance every 1 day
[15:13:58.870-0001-INF] Startup complete. Reducing console logging level to [Warning/Error].
[15:13:58.887-0001-WRN] No XML encryptor configured. Key {628edabf-f370-4a0d-905f-82bec0f62339} may be persisted to storage in unencrypted form.
[15:14:03.948-.NET TP Worker-WRN] Failed to determine the https port for redirect.

@grainsoflight
Copy link
Author

From Chrome's developer tools:

GET http://192.168.0.11:6363/_content/Syncfusion.Blazor.Themes/bootstrap5.css net::ERR_ABORTED 404 (Not Found)
(index):45 Uncaught TypeError: Cannot read properties of undefined (reading 'register')
at (index):45:37
(anonymous) @ (index):45
(index):46 Uncaught TypeError: Cannot read properties of undefined (reading 'register')
at (index):46:37
(anonymous) @ (index):46
blazor.webassembly.js:1 Error: Failed to start platform. Reason: TypeError: Cannot read properties of undefined (reading 'dotnet.wasm')
at Vt (blazor.webassembly.js:1:62226)
(anonymous) @ blazor.webassembly.js:1
Promise.catch (async)
(anonymous) @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
blazor.webassembly.js:1 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.keys ()
at blazor.webassembly.js:1:37659
at blazor.webassembly.js:1:38464
at Object.start (blazor.webassembly.js:1:46018)
at Vt (blazor.webassembly.js:1:62202)
(anonymous) @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
start @ blazor.webassembly.js:1
Vt @ blazor.webassembly.js:1
await in Vt (async)
(anonymous) @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1

@Webreaper
Copy link
Owner

Weird. It's running fine for me. What OS are you running on?

It might be related to some cleanup I was doing to the base image, but it's odd it works for me and not you. I'll build against the prev base image in the morning and see if that fixes it.

@grainsoflight
Copy link
Author

grainsoflight commented Jan 10, 2024 via email

@Webreaper
Copy link
Owner

Webreaper commented Jan 10, 2024 via email

@Webreaper
Copy link
Owner

Can you try pulling webreaper/damselfly:dev now? I've reverted the base image changes, so it should hopefully be better.

@grainsoflight
Copy link
Author

Its working now, date is showing up and faces areas are tagged which was unexpected but awesome. This copy of the image im adding has the caption field filled out, for all intents and purposes I only use the "caption" field and not an additional description field. Also, is there a way in the UI to turn the face region overlay off? I love it as it makes it really easyl to identifiy whos who, but it would be great if it could be quickly hidden to have a clearer view of the picture.

fastfoto_0804291 (1)

@Webreaper
Copy link
Owner

It should be pulling in caption, if it's not, I'll have a look.

If you click the "show objects" icon that should turn off face rects, and other AI labels.

@grainsoflight
Copy link
Author

Cool, found the show objects button. Yeah, I tested sever different fields that were some version of caption/description and it wouldnt pull from any. The file I just loaded has the "This is the caption" value in the field that makes the most sense in lightroom.

@grainsoflight
Copy link
Author

Also, unrelated and not really causing me an issue, but "sharpening..." never seems to go away above the image on the screen, just a heads up

@Webreaper
Copy link
Owner

I've just downloaded the image above, but even if I run it through exiftool I can't see any metadata in the image with the word "caption". Are you sure you a) saved the caption, and b) uploaded the right image?

Alternatively, if you could just run exiftool <imagename> on that image after you've saved the caption, and send me the output, I can probably figure out which tag I need to extract.

Unsure about the sharpening display. What's supposed to happen is that it loads a low-res image immediately, and then loads a higher-res preview, but depending on the system that can sometimes take a second or so to be generated. Once it is, it's loaded, and the 'sharpening' message should go away.

It's possible that your system is so fast some race condition is happening? :)

@grainsoflight
Copy link
Author

Yeah, idk. Its several hours later and it still says sharpening, but the pic looks fine. Weird.

Anyway, It looks like the lightroom UI calls it "Caption" but its actually writing in the "Description" field.

Screenshot 2024-01-12 at 2 38 45 AM

@Webreaper
Copy link
Owner

Webreaper commented Jan 12, 2024

Yes, I just spotted that. Must be having a bad morning.

So it seems the library I use to extra metadata tags can't load the XMP block of data from that image. I get an error returned saying it's an unsupported encoding type. Don't know why. Do you mind if I raise an issue and attach the photo so the developer can see if there's a fix?

In the meantime you might need to see if there's some other way you can do it. Perhaps you can also save the XMP stuff as a sidecar file?

It's possible I could rewrite the code to use exiftool, but that would be a significant effort, so wouldn't happen anytime soon (and I'd like to avoid doing it if possible).

@grainsoflight
Copy link
Author

Using the image is fine with me. I actually explored the sidecar option but lightroom doesnt seen to be able to do that for files that arent RAW. Ive already spent a couple years on this project so a little more time while the developer works on it wont hurt, Ill just work on the other facets of it first and leave this chunk of photos for last.

@Webreaper
Copy link
Owner

Okay, great. With a bit of luck we'll get a fix (the developer is quite responsive) and then you can just rescan, but hopefully the changes made this week will at least get you going!

@Webreaper
Copy link
Owner

Raised the issue here: drewnoakes/metadata-extractor-dotnet#356

@grainsoflight
Copy link
Author

🤷🏻‍♂️

@grainsoflight
Copy link
Author

@Webreaper It does look like we have a release candidate for the metadata library if you care to look at it now, or if you'd rather wait for the release thats fine

@Webreaper
Copy link
Owner

Yep, I need to sort out a release. But there's some other bits that are half done and aren't ready for release, but need tidying or hiding behind a feature flag before I push it out. Will try and do that in the next week or so.

In the meantime, you can continue using dev...

@grainsoflight
Copy link
Author

Just to clarify, I meant that @drewnoakes had a RC for metadata-extractor-dotnet. I wasn't sure from your response if we were talking about the same thing or not

@grainsoflight
Copy link
Author

And your dev seems to be working fine ever since the sharpening thing worked itself out

@drewnoakes
Copy link

The 2.9 release has a bunch of performance gains and some corresponding API changes (though most users won't notice them). Let me know if you encounter any issues updating to the RC build. We have a few more changes coming before we'll release the final build.

@Webreaper
Copy link
Owner

Sorry, missed what we were talking about. D'oh.

I'll update to the new RC and see how it looks.

@Webreaper
Copy link
Owner

Updated to 2.9 rc1, and pushed - new dev image should be there soon for some testing.

@grainsoflight
Copy link
Author

Will keep an eye out

@grainsoflight
Copy link
Author

Update, Still no information in the description field, there seems to be an error that may pertain to that in the logs when I reindex

02:27:51.470 | INF | ExtraLarge thumb created for fastfoto_0804291.png [load: 53ms, scale: 3ms, save: 41ms -- | -- | -- 02:27:49.492 | INF | Search: 0 images found in search query within 4ms 02:27:44.965 | INF | Processing AI image detection for fastfoto_0804291.png... 02:27:44.587 | INF | Read metadata for /pictures/Family Png 7/fastfoto_0804291.png (ID: 1673)   |   |     |   |   02:27:44.586 | ERR | Exception while parsing XMP face/region data: System.Collections.Generic.KeyNotFoundException: The given key 'exif:Description' was not present in the dictionary. 02:27:44.355 | INF | Full index compelete. 02:27:43.758 | INF | Performing full index.

@Webreaper
Copy link
Owner

Will take a look when I can.

@grainsoflight
Copy link
Author

I also just now noticed that I no longer see 3 metadata fields, including the caption field, in the Image properties section at all, empty or otherwise, after a refresh

@Webreaper
Copy link
Owner

I haven't tested the build, I literally just updated the dependency. I'll take a look when I get a chance.

@grainsoflight
Copy link
Author

Its cool, just wanted to let you know that I noticed those fields missing

@grainsoflight
Copy link
Author

While it didnt resolve the error in the logs or populate the fields, restarting the whole docker container did bring back the metadata fields that had vanished, so that appears to have just been another fluke

@grainsoflight
Copy link
Author

Update, Still no information in the description field, there seems to be an error that may pertain to that in the logs when I reindex

02:27:51.470 | INF | ExtraLarge thumb created for fastfoto_0804291.png [load: 53ms, scale: 3ms, save: 41ms -- | -- | -- 02:27:49.492 | INF | Search: 0 images found in search query within 4ms 02:27:44.965 | INF | Processing AI image detection for fastfoto_0804291.png... 02:27:44.587 | INF | Read metadata for /pictures/Family Png 7/fastfoto_0804291.png (ID: 1673)   |   |     |   |   02:27:44.586 | ERR | Exception while parsing XMP face/region data: System.Collections.Generic.KeyNotFoundException: The given key 'exif:Description' was not present in the dictionary. 02:27:44.355 | INF | Full index compelete. 02:27:43.758 | INF | Performing full index.

This error message no longer appears in most recent dev image, however original problem persists

@grainsoflight
Copy link
Author

@Webreaper Were you able to get this working on your end? The fields are still not populating on mine

Webreaper added a commit that referenced this issue Mar 12, 2024
@Webreaper
Copy link
Owner

Sorry, couple of oversights... pushed a fix to dev - can you confirm it works, and if so I'll push a new release.

@grainsoflight
Copy link
Author

Unfortunately no, looks like the fields are still empty

Screenshot 2024-03-12 153828

@Webreaper
Copy link
Owner

Webreaper commented Mar 12, 2024

Did you refresh and rescan metadata? It's definitely working for me now.

To sanity check, rename the file so it's ingested from new.

@grainsoflight
Copy link
Author

Im getting a persistent error with metadata processing

An exception occurred in the database while saving changes for context type 'Damselfly.Core.Database.ImageContext'. --   |   |     |   |     |   |   16:42:07.876 | ERR | Failed executing DbCommand (0ms) [Parameters=[@p23='?' (DbType = Int32), @p0='?' (DbType = DateTime), @p1='?' (DbType = Double), @p2='?' (Size = 7), @p3='?' (DbType = Int32), @P4='?', @p5='?', @p6='?', @P7='?' (DbType = DateTime), @p8='?' (Size = 19), @p9='?', @p10='?', @p11='?', @p12='?' (DbType = Boolean), @P13='?' (DbType = Int32), @p14='?', @P15='?' (DbType = Int32), @p16='?' (DbType = DateTime), @p17='?' (DbType = Double), @p18='?' (DbType = Int32), @p19='?' (DbType = Double), @p20='?' (DbType = Int32), @p21='?' (DbType = DateTime), @p22='?' (DbType = Int32)

@Webreaper
Copy link
Owner

Is there more error info than that in the logs? That's not much to go on. I wonder if the DB schema change didn't work when it upgraded to the new version....

If the metadata isn't working, you're not going to see the new data.

@Webreaper Webreaper reopened this Mar 12, 2024
@Webreaper
Copy link
Owner

Actually, ignore this - I can see the error. Investigating.

@Webreaper
Copy link
Owner

Okay, dev should be better now. Can you try it out?

@grainsoflight
Copy link
Author

SUCCESS!

@Webreaper
Copy link
Owner

WOOT!!!

Thanks. I'm going to make a patch release. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants