Local Image Optimizer never finishes scanning on larger site

Hi there,

I’ve found Image Optimizer a godsend for our many sites, and it’s the best bulk image optimizer for WordPress that no one knows about.

Makes me that much sadder that in a month I’ve not been able to get around an issue where Local never gets past the “Scanning…” stage once the site gets too large for it.

I have one site dating back to 2008 with uploads containing 91321 images with 3.93GB of space.

I’ve tied running the scan for 5 hours, 4 hours another day with no other software open.
I then pre-pruned the directories, reducing the file amount to 70000. As a final test I took out most years to end up under 20000 files.

Still, all I get is the button greyed out saying “scanning”.

I’m on Local Version 8.1.0+6514 with Image Optimizer v2.1.2, running on Windows 10 Pro.

Based on Task Manager’s readouts, nothing seems to be really happening after the initial call is made.

I really don’t get it, as Image Optimizer was able to scan a 5000-image site in less than a minute.

For that site I have both a REQUEST and SUCCESS in the log:

{“addonName”:“@getflywheel/local-addon-image-optimizer”,“addonVersion”:“2.1.2”,“class”:“AddonImageOptimizer”,“level”:“info”,“message”:“Scanning REQUEST for site DQujfSYpt”,“thread”:“main”,“timestamp”:“2023-11-02T16:58:20.758Z”}
{“addonName”:“@getflywheel/local-addon-image-optimizer”,“addonVersion”:“2.1.2”,“class”:“AddonImageOptimizer”,“level”:“info”,“message”:“Scanning SUCCESS for site DQujfSYpt. Found 1535 image(s).”,“thread”:“main”,“timestamp”:“2023-11-02T16:58:51.261Z”}

While on the larger site each scan is only noted with a REQUEST and nothing else is logged.

{“addonName”:“@getflywheel/local-addon-image-optimizer”,“addonVersion”:“2.1.2”,“class”:“AddonImageOptimizer”,“level”:“info”,“message”:“Scanning REQUEST for site S9_cww1Fs”,“thread”:“main”,“timestamp”:“2023-12-17T14:29:21.118Z”}

I’ve been trying to solve this for a month.

Any ideas would be greatly appreciated.

Kind regards,
Adam

I’m facing the same/similar issue.

Hi @AdamWeirdly and @simii

I’ve shared this with the team and while we don’t have any built-in limits for this it seems the best practice is to break up the workload. There may be some trial and error involved. As you mentioned a 5,000-image site can go pretty quickly. I’m not sure if the same can be said for 10,000, 20,000, etc. I understand this might not be ideal when working with over 100,000 images, but as long as they are completed quickly in the 5,000-10,000 range it should make short work of the overall task at hand. :green_heart:

Hi @Nick-B, thanks so much for clarifying!

I didn’t know that simply moving files in and out would help with Local focusing on those files only, but lo and behold, it does the trick!

One thing I would like to ask that you implement is a “Stop scanning” function when an Image Scan has been started and not yet finished. When I have too many files for a run (and I can’t tell before I run the scan), I have to close and restart Local and the site to see if the lowered number of files will work.

Another thing that keeps happening is this error:

I’ve had it pop up when trying to start a 4417-file run and then a 2247-file run, but I suspect it’s based on the total number of files optimised per session. The error requires closing Local and restarting again, but that’s still not too much of a hassle.

Anyway, big sigh of relief overall, thank you!

Hi @AdamWeirdly -

So happy to hear that @Nick-B’s suggestions helped. I’ll be sure to pass off the rest of the feedback to the Local engineering team.

We appreciate you,

Sam