Opened 14 years ago

Closed 13 years ago

#9523 closed Bug Report (Won't Fix)

[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 (1)

90-gallery-thumb.diff (559 bytes) - added by Lawrence Rust <lvr@…> 14 years ago.

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by Lawrence Rust <lvr@…>

Attachment: 90-gallery-thumb.diff added

comment:1 Changed 14 years ago by beirdo

Milestone: unknown0.25
Resolution: Fixed
Status: newclosed

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 14 years ago by Lawrence Rust

Resolution: Fixedfixed

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 14 years ago by paulh

Resolution: fixed
Status: closednew

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:4 Changed 13 years ago by Raymond Wagner

Status: newassigned

comment:5 Changed 13 years 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 13 years ago by beirdo

Resolution: Won't Fix
Status: assignedclosed
Note: See TracTickets for help on using tickets.