Ticket #9523 (closed Bug Report: Won't Fix)
Opened 2 years ago
Last modified 22 months ago
[PATCH] MythGallery hogs cpu when scanning folders with non-image files.
| Reported by: | Lawrence Rust <lvr@…> | Owned by: | beirdo |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.25 |
| Component: | Plugin - MythGallery | Version: | Master Head |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
If I set MythGallery to read images from a folder containing a mix of images and other files then the UI hangs for a long time while it's trying to detect the format of the non-image files. This is a feature of the Qt QImageReader class which outputs many messages of the form:
Cannot decode file /home/...
while it attempts to analyse the format of these files. A solution is to call setAutoDetectImageFormat(false) before calling canRead() so that only files with known image extensions (e.g. .jpeg .gif etc) are tested.
Attachments
Change History
comment:1 Changed 2 years ago by beirdo
- Status changed from new to closed
- Resolution set to Fixed
- Milestone changed from unknown to 0.25
Committed in d1ab62dc3dee on master. This may lead to us having to add more registered file extensions now, but I expect this will be a minimal issue if at all. Thanks.
comment:2 Changed 2 years ago by Lawrence Rust
- Resolution changed from Fixed to fixed
Make mythgallery's thumb generator not auto-detect
The QImageReader autodetection seems to be overkill for what we need here. By turning this off, only registered image extensions will be tried. This will significantly speed up scanning directories with mixed content in them.
Hopefully, this will not adversely affect "normal" directories of only images.
Fixes #9523
Signed-off-by: Gavin Hurlbut <ghurlbut@…>
Changeset: d1ab62dc3dee829e75dd649b36adc875ca06643a
comment:3 Changed 2 years ago by paulh
- Status changed from closed to new
- Resolution fixed deleted
This change has broken MythGallery for me. Any new folders added since this change don't get their thumbnail created and what's worse is because testread.canRead() always returns false with this change each time I open MythGallery it scans every image in every directory looking for a thumb image for the new directory and never finds one. After reverting this change the thumbnail is created OK all is well again.
comment:5 Changed 22 months ago by Github
Revert "Make mythgallery's thumb generator not auto-detect"
This reverts commit d1ab62dc3dee829e75dd649b36adc875ca06643a.
Ref #9523
Seems that this well-intentioned patch does in fact break the thumbnails for directories completely. As this is the case, I'm removing it. We do plan to completely rework mythgallery to be using the mythui throughout, and perhaps at that time, we can look at making it more efficient. In the meantime, this is borked, so it's coming out.
Branch: master Changeset: 6ef7b6ec40f42560e451327122500bd313c08e66
comment:6 Changed 22 months ago by beirdo
- Status changed from assigned to closed
- Resolution set to Won't Fix
