v411e / ppim-migrator

Tool for migrating albums and favorites from photoprism to immich
https://pypi.org/project/ppim-migrator/
20 stars 2 forks source link

With this work with content in external libraries? #7

Open psyciknz opened 2 days ago

psyciknz commented 2 days ago

Or is it just designed for uploaded (library) photos.

And I assume if an underlying photo has been physically renamed then the tool wont find it? You don't perform a hash search on an item?

v411e commented 2 days ago

The tool was initially designed to work on an external photo library which gets mounted as read only by both photoprism and immich.

As you correctly pointed out, there is no hash comparison, just a file name and file path comparison. I tried to implement it in a way which would compare the images b by hash, but it did not work out. Photoprism does offer a hash and Immich does offer a search based on a hash but I think the hash calculations are not the same. However, if it'd turn out to be possible to compare them by hash, I would prefer that.

psyciknz commented 2 days ago

Hmm, yes, hashing an image and ignoring the metadata content. Something I was trying in csharp. By pulling apart an image into its segments and only hashing the image content.

But who knows what photoprism does. I know immich's checksum is some weird sha1 then base64 encoded.

I have a program that copies photos (csharp) from a base dir and performs actions based on the camera type. I was adapting that to read from the immich upload dir/storage library. And them moving to an external library when camera = mirrorless, leaving just my iphone photos.

Am thinking of using your api code for photoprism - which seems ot be the only place it's documented - how to get photos for an album, to migrate from photoprism to immich...or at least update sidecar files from photoprism

v411e commented 1 day ago

Yes, feel free to use the code wherever you like. The photoprism API is in fact not really documented (or I didn't find the right docs).

If you figure out, how to match the hashes of photoprism and Immich, I'd be interested :)

psyciknz commented 1 day ago

I’m not sure how good they are. Their hashes. If it’s just sha1 etc. what that doesn’t account for is alterations to exif.

so nice out down a library (for csharp). That does perceptual hashing. So at least if image the same but metadata changed it still matches them.