Bug 421559 - HEIC: Failed to open the data source: Too many open files (errno = 24)
Summary: HEIC: Failed to open the data source: Too many open files (errno = 24)
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 7.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-15 11:51 UTC by Andrius
Modified: 2020-05-15 19:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius 2020-05-15 11:51:36 UTC
dk7rc win64 I just imported 8,925 of JPGs, HEICs and MOV files and now digikam
can't create thumbnails for many of them (looks like HEIC only because JPGs and MOVs seem to be fine) while Showfoto opens them without a problem. My import I mean simply adding files into a folder via Windows Explorer.

[15684] digikam.metaengine: Cannot load metadata from file C:/Users/user/Pictures/FamilyPictures/DCIM_2020-05-13/IMG_S2437.HEIC  (Error # 9 :  C:/Users/user/Pictures/FamilyPictures/DCIM_2020-05-13/IMG_S2437.HEIC: Failed to open the data source: Too many open files (errno = 24)
[15684] Error: Could not open source file.
[15684] digikam.dimg: "C:/Users/user/Pictures/FamilyPictures/DCIM_2020-05-13/IMG_S2437.HEIC" : Unknown image format !!!
[15684] digikam.general: Cannot extract preview for "C:/Users/user/Pictures/FamilyPictures/DCIM_2020-05-13/IMG_S2437.HEIC"
[8836] 13028 0000000000000000 ENTER: DllCanUnloadNow
Comment 1 Maik Qualmann 2020-05-15 14:23:19 UTC
Yes, I can reproduce the problem on Windows. I'm looking at Linux tonight to see if the open files are growing. The problem must also occur with the Beta2. It depends on how many HEIF files you open. It is not Exiv2 that the files do not close, but the HEIF Loader. I suspect that libheif does not close the files. We updated the libheif, but there were no changes in the File IO area.

Maik
Comment 2 Andrius 2020-05-15 14:27:37 UTC
(In reply to Maik Qualmann from comment #1)
> Yes, I can reproduce the problem on Windows. I'm looking at Linux tonight to
> see if the open files are growing. The problem must also occur with the
> Beta2. It depends on how many HEIF files you open. It is not Exiv2 that the
> files do not close, but the HEIF Loader. I suspect that libheif does not
> close the files. We updated the libheif, but there were no changes in the
> File IO area.
> 
> Maik

I switched back to beta2 and looks like it is working fine.
I have 3,639 HEIC files in the folder which caused that problem.

I also noticed that "open in file manager" wasn't working for the affected files either. It seems like digiKam simply wasn't able see them.
Comment 3 Maik Qualmann 2020-05-15 14:34:42 UTC
In a folder with around 200 HEIC files, try using F5 to create new thumbnails.

Maik
Comment 4 Maik Qualmann 2020-05-15 18:47:41 UTC
Git commit fbad9b49fe4d8f3a423a16910cb1e55a1a77de5a by Maik Qualmann.
Committed on 15/05/2020 at 18:45.
Pushed by mqualmann into branch 'master'.

release HeifContext at the end of loading
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +13   -2    core/dplugins/dimg/heif/dimgheifloader_load.cpp

https://invent.kde.org/kde/digikam/commit/fbad9b49fe4d8f3a423a16910cb1e55a1a77de5a
Comment 5 Maik Qualmann 2020-05-15 19:13:50 UTC
Git commit 136e3b27d07e0e5ef0122f3034054fe08c09d12d by Maik Qualmann.
Committed on 15/05/2020 at 19:11.
Pushed by mqualmann into branch 'master'.

simplify the HeifContext fix

M  +6    -12   core/dplugins/dimg/heif/dimgheifloader_load.cpp

https://invent.kde.org/kde/digikam/commit/136e3b27d07e0e5ef0122f3034054fe08c09d12d