helgeerbe / picframe

Picture frame viewer for raspi, controlled via mqtt and automatticly integrated as mqtt device in homeassistant.
MIT License
110 stars 32 forks source link

New images inserted into DB but EXIF data missing and these new images never appear. #413

Open jasonarmbrecht opened 1 week ago

jasonarmbrecht commented 1 week ago

When attempting to add new images to picframe, the application will correctly identify new images to process, but the process appears to fail.

The new images appear in the database with the fname, last_modified, file_id, orientation, and exif_datetime added, but no other information is inserted despite these image files having a large amount of EXIF data.

When imported, and added to the DB, the new images are also never displayed.

The only solution is the delete the DB and have it rebuilt, but then obviously it doesn't display newly added images first, which is what I want.

Ive checked file/folder permissions, file corruption etc.

I suspect the error occurs as a result of the slow network copy operation into the Pictures folder. Watching the tail output of the log, these checks for new images were happening regularly, and thus they were occurring while the file was still copying over from a network location. But I am not sure how to solve this.

Raspberry Pi 4B 4GB OS and all software (lastest/stable) for this frame was pulled within the last 3 weeks.

Debug log output:

2024-11-11 16:43:36,569 - image_cache.ImageCache - DEBUG - Updating cache
2024-11-11 16:43:36,570 - image_cache.ImageCache - DEBUG - No unprocessed files in memory, checking disk
2024-11-11 16:43:36,715 - image_cache.ImageCache - DEBUG - Found 1 new files on disk
2024-11-11 16:43:36,716 - image_cache.ImageCache - DEBUG - Inserting: /media/usb/Pictures/IMG_5481.JPG
2024-11-11 16:43:36,717 - PIL.Image - DEBUG - Importing BlpImagePlugin
2024-11-11 16:43:36,722 - PIL.Image - DEBUG - Importing BmpImagePlugin
2024-11-11 16:43:36,722 - PIL.Image - DEBUG - Importing BufrStubImagePlugin
2024-11-11 16:43:36,724 - PIL.Image - DEBUG - Importing CurImagePlugin
2024-11-11 16:43:36,726 - PIL.Image - DEBUG - Importing DcxImagePlugin
2024-11-11 16:43:36,729 - PIL.Image - DEBUG - Importing DdsImagePlugin
2024-11-11 16:43:36,741 - PIL.Image - DEBUG - Importing EpsImagePlugin
2024-11-11 16:43:36,745 - PIL.Image - DEBUG - Importing FitsImagePlugin
2024-11-11 16:43:36,750 - PIL.Image - DEBUG - Importing FliImagePlugin
2024-11-11 16:43:36,753 - PIL.Image - DEBUG - Importing FpxImagePlugin
2024-11-11 16:43:36,755 - PIL.Image - DEBUG - Image: failed to import FpxImagePlugin: No module named 'olefile'
2024-11-11 16:43:36,756 - PIL.Image - DEBUG - Importing FtexImagePlugin
2024-11-11 16:43:36,758 - PIL.Image - DEBUG - Importing GbrImagePlugin
2024-11-11 16:43:36,760 - PIL.Image - DEBUG - Importing GifImagePlugin
2024-11-11 16:43:36,760 - PIL.Image - DEBUG - Importing GribStubImagePlugin
2024-11-11 16:43:36,762 - PIL.Image - DEBUG - Importing Hdf5StubImagePlugin
2024-11-11 16:43:36,763 - PIL.Image - DEBUG - Importing IcnsImagePlugin
2024-11-11 16:43:36,767 - PIL.Image - DEBUG - Importing IcoImagePlugin
2024-11-11 16:43:36,772 - PIL.Image - DEBUG - Importing ImImagePlugin
2024-11-11 16:43:36,776 - PIL.Image - DEBUG - Importing ImtImagePlugin
2024-11-11 16:43:36,779 - PIL.Image - DEBUG - Importing IptcImagePlugin
2024-11-11 16:43:36,781 - PIL.Image - DEBUG - Importing JpegImagePlugin
2024-11-11 16:43:36,781 - PIL.Image - DEBUG - Importing Jpeg2KImagePlugin
2024-11-11 16:43:36,781 - PIL.Image - DEBUG - Importing McIdasImagePlugin
2024-11-11 16:43:36,783 - PIL.Image - DEBUG - Importing MicImagePlugin
2024-11-11 16:43:36,786 - PIL.Image - DEBUG - Image: failed to import MicImagePlugin: No module named 'olefile'
2024-11-11 16:43:36,786 - PIL.Image - DEBUG - Importing MpegImagePlugin
2024-11-11 16:43:36,788 - PIL.Image - DEBUG - Importing MpoImagePlugin
2024-11-11 16:43:36,791 - PIL.Image - DEBUG - Importing MspImagePlugin
2024-11-11 16:43:36,794 - PIL.Image - DEBUG - Importing PalmImagePlugin
2024-11-11 16:43:36,798 - PIL.Image - DEBUG - Importing PcdImagePlugin
2024-11-11 16:43:36,800 - PIL.Image - DEBUG - Importing PcxImagePlugin
2024-11-11 16:43:36,801 - PIL.Image - DEBUG - Importing PdfImagePlugin
2024-11-11 16:43:36,827 - PIL.Image - DEBUG - Importing PixarImagePlugin
2024-11-11 16:43:36,829 - PIL.Image - DEBUG - Importing PngImagePlugin
2024-11-11 16:43:36,829 - PIL.Image - DEBUG - Importing PpmImagePlugin
2024-11-11 16:43:36,830 - PIL.Image - DEBUG - Importing PsdImagePlugin
2024-11-11 16:43:36,832 - PIL.Image - DEBUG - Importing QoiImagePlugin
2024-11-11 16:43:36,835 - PIL.Image - DEBUG - Importing SgiImagePlugin
2024-11-11 16:43:36,837 - PIL.Image - DEBUG - Importing SpiderImagePlugin
2024-11-11 16:43:36,841 - PIL.Image - DEBUG - Importing SunImagePlugin
2024-11-11 16:43:36,844 - PIL.Image - DEBUG - Importing TgaImagePlugin
2024-11-11 16:43:36,846 - PIL.Image - DEBUG - Importing TiffImagePlugin
2024-11-11 16:43:36,847 - PIL.Image - DEBUG - Importing WebPImagePlugin
2024-11-11 16:43:36,881 - PIL.Image - DEBUG - Importing WmfImagePlugin
2024-11-11 16:43:36,883 - PIL.Image - DEBUG - Importing XbmImagePlugin
2024-11-11 16:43:36,886 - PIL.Image - DEBUG - Importing XpmImagePlugin
2024-11-11 16:43:36,888 - PIL.Image - DEBUG - Importing XVThumbImagePlugin
2024-11-11 16:43:36,893 - get_image_meta.GetImageMeta - WARNING - Can't open file: "/media/usb/Pictures/IMG_5481.JPG"
2024-11-11 16:43:36,894 - get_image_meta.GetImageMeta - WARNING - Cause: cannot identify image file '/media/usb/Pictures/IMG_5481.JPG'
2024-11-11 16:43:36,895 - get_image_meta.GetImageMeta - WARNING - Can't open file: "/media/usb/Pictures/IMG_5481.JPG"
2024-11-11 16:43:36,896 - get_image_meta.GetImageMeta - WARNING - Cause: cannot identify image file '/media/usb/Pictures/IMG_5481.JPG'
2024-11-11 16:43:36,896 - get_image_meta.GetImageMeta - WARNING - get_size failed on /media/usb/Pictures/IMG_5481.JPG -> 'NoneType' object has no attribute 'size'
2024-11-11 16:43:39,027 - image_cache.ImageCache - DEBUG - Updating cache
2024-11-11 16:43:39,027 - image_cache.ImageCache - DEBUG - No unprocessed files in memory, checking disk
2024-11-11 16:43:39,045 - image_cache.ImageCache - DEBUG - Found 0 new files on disk
2024-11-11 16:43:41,057 - image_cache.ImageCache - DEBUG - Updating cache
2024-11-11 16:43:41,057 - image_cache.ImageCache - DEBUG - No unprocessed files in memory, checking disk
2024-11-11 16:43:41,067 - image_cache.ImageCache - DEBUG - Found 0 new files on disk
2024-11-11 16:43:43,077 - image_cache.ImageCache - DEBUG - Updating cache
2024-11-11 16:43:43,078 - image_cache.ImageCache - DEBUG - No unprocessed files in memory, checking disk
2024-11-11 16:43:43,088 - image_cache.ImageCache - DEBUG - Found 0 new files on disk
2024-11-11 16:43:45,099 - image_cache.ImageCache - DEBUG - Updating cache
2024-11-11 16:43:45,099 - image_cache.ImageCache - DEBUG - No unprocessed files in memory, checking disk
2024-11-11 16:43:45,108 - image_cache.ImageCache - DEBUG - Found 0 new files on disk
2024-11-11 16:43:45,957 - image_cache.ImageCache - DEBUG - Update file stats: Wait for 0 ms and need 0 ms for update
image
helgeerbe commented 1 week ago

Hm, you could cancel picframe, copy images, resart picframe.

Or you could run 'touch' on the copied filed. If I remember right picframe, will reimport the meta data.

The contents of the file will not be lost, and it won't even be modified. The only thing that happens when you run touch on an already existing file is that the file's access and modification timestamps are updated to the current time.