0

I was writing a script and ran into some perculiar behaviour.

For instance, do something like:

newDir='/sdcard/Pictures/NewDirectory/'
oldDir='/sdcard/Pictures/Screenshots/'
newPic='Screenshot_Copy'
oldPic='Screenshot_20180830-142827'  
mkdir  "/$newDir/"
cp     "/$oldDir/$oldPic.png" \
       "/$newDir/$newPic00.png"

Then exit/open the Google Photos app, a new local album/folder, containing the new/copy image will appear.

But if I repeat the procedure, or make multiple copies of the same picture instead:

mkdir  "/$newDir/"

for xy in {01..10};
do
    cp "/$oldDir/$oldPic.png" \
       "/$newDir/$newPic$xy.png";
done

ls -al "/$newDir/"

Only one image appears in the new album/folder, but ls clearly shows several. Add a unique image to the same directory, and it automatically (after restarting the app) appears in the album/folder.

So it seems like the pictures are compared for similarities, and copies are omitted, which seems odd. Especially because it's possible for consecutive identical copies to be seen occupying the same album/folder:

enter image description here

Can anyone explain what's going in here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.