Image Optimizer stuck on scanning

I thought I’d finally give the Image Optimizer a try. I clicked “Scan” and it’s been scanning for about an hour without any indication anything is actually happening (Total Reductions is still zero).

I’m unclear from the UI if “scan” means to create an index which is followed by a prompt to begin optimizing or if it’s actually alrteady tyring to optimize things.

This is a medium sized site (15GB uploads folder).

I can’t figure out a way to kill the process either.

I’m glad you’re giving it a try – especially stress-testing on a larger uploads folder.

The scan job is scanning the filesystem for images that can be optimized. Once that scan has finished, you’ll be prompted do the actual optimization process. There’s a ~30 sec video on this help doc that shows everything on a smaller site:

Can you “see” the process somewhere? If you quit Local, are there any errors within the Local log?

Thank you @ben.turner the video helps.

It’s still stuck on scanning. I know it’s doing “something” because Local is using 50-100% of 1 CPU continuously. But it’s literally been over an hour. Restarting, and stoping the site had no affect (didn’t think it would necessarily), so I closed Local and reopened. That stopped things.

However, in the mean time I kind of gave up and threw another copy of the uploads folder at ImageOptim, so that’s now using all my CPUs.

FWIW, uploads is 11.9 GB on disk for 125,070 items. It’s not small, but it’s huge either. I do know there is at least one file in there with the wrong extension (PSD someone renamed to .jpg) as ImageOptim refused to compress it.

I’ll try restarting, but I do feel this UI needs some kind of feedback that “scanning” is taking place. Like “scanned 1000 or 125,070 items” or something… although I still think it’s dying in the background without notice.

Of course they did! :smiley:


This was an interesting thing to replicate. I’m not sure what the limit is in terms of size, but it looks like Local is spawning the “Local Helper” process which I was able to kill with Activity Monitor (I think I remember you’re on a mac)

I’ll put something in the backlog for the devs to look into the performance of image optimizer.

For others that want an easy-ish was to create a bunch of jpgs to take up space, I downloaded an image from unsplash, moved it to the uploads folder of a site and then ran these terminal commands:

mkdir -p {2010..2020}/{01..12}
for d in $(echo {01..99} | tr " " "\n"); do cp kevin-oetiker-k51zbGzqqQ-unsplash.jpg ${d}.jpg ; done; 
for d in $(echo {2010..2020}/{01..12} | tr " " "\n"); do cp *.jpg ${d}/ ; done;                                
du -sh ./

1 Like

lol, nice code. I’m putting that in a gist to run on some poor unsuspecting friend’s laptop next time I’m at a WordCamp and they leave their laptop unattended. I think this is why I never see @afragen bring his laptop to events…

FYI, Local Beta Helper is running according to activity monitor (this is inside iStat Menus), it’s just it’s been quite a while and still no actual feedback in the Local UI.

2 Likes

You can borrow my laptop anytime @jb510 :wink:

Pretty sure I can mitigate the script. Though, I’d also include the image in the gist and include the terminal command to just run it all.

The image optimizer only seems to work with JPEG.

1 Like

Aw, just teasing you my friend and dreaming of a day I see WordFolk in person again…

Image Optimize is JPG only by design (or at least current design, that’s in the docs).

I needed to bulk optimize this site so figured it’d be a decent case to test it out. Usually I use EWWW (WP CLI) or ImageOptim (MacOS).

1 Like

Hello hello,
I hope it’s okay to revive this topic as I’ve run into what seems to be the exact same issue two years on.
I’m trying to run Image Optimizer on a site that has uploads dating back 2008.
The uploads folder is 5.9GB with 99928 files, from which .jpg files total 91321 with 3.93GB of space.
The first time I left it on for 5 hours a couple weeks ago, then I tried again today for 4 hours.
All I get is the button greyed out saying “scanning”.

The only difference between the two tries is that the first time there was nothing else but the Scan button, now there’s the four rows with all numbers on 0.

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.

(Above is Apps, below is Background processes.)

I have two other sites currently in Local, for one Image Optimizer found 1524 images to compress, for the other it found 5021 images. I timed this second process to less than 1 minute.

The only thing I could think of is to search for accented characters in the filenames. I found some from 2013 with á and ó, and four files with the bane of file systems everywhere, the Hungarian ő. I renamed these and restarted Local to try again.

I’m a further hour in and no juice.

Here’s the end of the log:

Any ideas on what might be the issue, and what I can do to make it work?

Cheers,
Adam