Motivated by the change in Google Photos that stopped offering “free storage” I worked on a script that would resize images on my Android phone and released the first version in November 2022. The script requires Tasker to run.

There were a couple of problems with it, however. I wasn’t entirely happy with the workflow.
- Images were deleted from DCIM/Camera immediately (and moved elsewhere), making it impossible to review the image I just photographed in the camera gallery.
- When I opened the gallery app separately, the resized images wouldn’t show until some time later, or not at all. I verified the files were there using a file manager. Android’s media system just didn’t know about them.
I put up with these downsides for quite a while, occasionally researching how to fix the disappearing image problem, but I couldn’t find any good answer until last month.

I found out that Tasker must run the “Media Scan” command when it creates a new image file. The documentation says you can give it a directory, but that didn’t work for me. When I gave it the filename of the newly created image, it all worked! The image appeared in my gallery apps immediately!
Next up was the problem with deleted images. Originally, I moved the files into a “work in progress” directory to easily work on them, but if I left them in DCIM/Camera, I could check if a file of the same name existed in DCIM/Resized/. If it didn’t, then it’s time for a new file!
That did leave the problem that files were left in DCIM/Camera. Some of which might have been resized, some not. (It happens if I burst mode photos, where the task starts and works while new files are being created. It doesn’t catch the very new files). I created a new task “Photo Backup” that simply runs the resize task, and then runs the shell command “mv
” to move all the Jpg files to where Lightroom will see them on my computer. I added that task to my launcher with an icon. I tap that when I get home and within a few minutes, the files are synced to my computer, using Syncthing.

To better track changes, I’ve uploaded the task to GitHub in this Resize Images task for Tasker repository. All development happens on my phone, and I’ll publish it to Taskernet first, but then changes will be copied there.
To install the task, go to the Taskernet page for it on your phone and click on Import. You can also manually import the .xml file if you like. How you use the task is up to you, but I created a profile that uses the “File Modified” event, and gave it “DCIM/Camera” as the File. The action to fire is the “Resize Jpeg Files And Leave Originals” task listed here.