On Photoprism Claude, and HEIC Files on a Pi
Reading Time: 2 minutesWhen I migrated my Photoprism library from an HP Laptop to a Pi5 I found that there was a nine thousand photo hole in the total photo count. It's when I looked closer that I found that the gap between expected photos and actual photos is down to Photoprism and the Pi5 not playing nicely when it comes to HEIC files.
I decided to experiment with Claude AI as it is flavour of the month and the first advice it gave was "force reindex the entire library". Anyone who has played with raspberry Pi will know why that was an absurd proposition. I played along anyway and within minutes my Pi was sulking so I went for a walk, on the off chance that it would be ready when I got home. It was still sulking, and worse than that, pings took up to 30 milliseconds or more.
I tried sudo reboot, and I tried a soft reset via the button. I waited a while and when neither worked I went for a hard reboot. That's when the photo drive failed to mount properly so I rebooted the Pi properly and the drive mounted so I could continue.
The Photosync JPEG experiment
Now that we see that blind trust in Claude is misplaced we can use the human rational mind. As I saw that the photos that were missing appeared to be iphone photos I decided to change the photosync presets for uploading to the Pi5 Photoprism instance. I told it only to upload JPEGs. I refreshed the index via the web UI.
The Shell Script
Now that we determined that the HEIC files were missing and that refreshing the index was not working we went ahead with creating a shell script that would convert HEIC files to jpeg files using heif-convert.
The shell script found the HEIC files, in situ, converted them to jpeg and then deleted the HEIC files. The result is a HEIC free library.
The Result
After re-indexing the library with the jpegs we had 115,000 files, rather than 110,000 so we recovered 5000 files, out of 9000. When I explored the library this morning I saw that the iphone photos seem to be there, and that the library, especially for recent photos, is healthier.
Tensorflow Disable: True
In this situation it was necessary to disable tensorflow because it led to the Pi crashing twice, where I had to hard reset. With Immich you have granular control on what it is doing so with a Pi you can be as gentle, or as demanding as you want. If you're gentle it runs for hours, without crashing. If you're not it crashes.
Disabling tensorflow allowed me to try a final index within minutes rather than hours, or days.
And Finally
The calamity of having 9000 images, seemingly all camera phone photos missing can be quite distressing, until you realise that the missing images appear to be HEIC files. I know that I prefer to keep HEIC files, rather than converted files, when possible. With Photoprism, and a Pi5 it makes sense to keep things simple, and upload JPEGs.
Due to these circumstances I see Photoprism on the Pi as a backup solution.
#converting #heic #jpeg #pi #script #shell






