codez / ImportPhotoFolders

Import a folder hierarchy as albums into OS X Photos.
MIT License
247 stars 42 forks source link

Nested images disappear or get renamed to parent folder names #9

Closed mareeba closed 8 years ago

mareeba commented 8 years ago

Thanks for writing this - very much what I was looking for trying to consolidate a large number of architectural images that are spread across many directories.

Problem I am having is that on running the script on a small test directory I noticed that some of the (nested) images are disappearing, others are being renamed to that of the folder name that they are located within. Also, some nested folders are failing to import altogether (although I am not sure if this was intentional or not perhaps?) See the following before and after screen shots:

before-import

after-import

Any ideas how to prevent this from happening? For our purposes it is critical that we preserve the original image/filenames (and also any pre-existing metadata / tags etc.).

Ideally what would be great would be if we could simply import all the images contained within a given directory (including recursively searching within any nested directories) and keep all the filenames and any metadata intact. Any help with this would be most appreciated!

codez commented 8 years ago

I do not see any irregularity from the pictures you posted. All folders and albums are there as expected. Folders may only contain albums, while albums may only contain pictures in Photos. From the screen-shot, I cannot see any issues with individual images.

Any settings about metadata available may be configured in Photos > Settings.

This script is just 'remote controlling' Photos and is therefore limited to do what Photos can.

mareeba commented 8 years ago

Thanks for the quick response! To be clear, on the top photo I attached ('Before' the script is run) you can see that there are the following images and directories (3 directories and 7 images in total):

Top-Level-Folder-------------------------- BEFORE ---_image-01TLF.png ---_image-02TLF.png ---_image-03TLF.jpg ---------Nested-Level-1-Folder ------------_image-04NL1F.jpg ------------_image-05NL1F.jpg ------------------Nested-Level-2-Folder ---------------------_image-06NL2F.jpg ---------------------_image-07NL2F.jpg

On the lower photo I attached above ('After' the script is run) you can see that there are the following (2 directories and 3 images in total):

Top-Level-Folder-------------------------- AFTER ---------Nested-Level-1-Folder ------------image (not sure which one as it has been renamed 'Nested-Level-1-Folder.jpg') ------------image (not sure which one as it has been renamed 'Nested-Level-2-Folder.jpg') ---image (not sure which one as it has been renamed 'Nested-Level-2-Folder.jpg')

So you can clearly see that there is indeed some irregularity :) Basically the script has arbitrarily deleted 4 images and 1 directory!

Any ideas?

codez commented 8 years ago

The lower screenshot shows the tree of folders and albums, not images. One image of the album is taken for the album icon. The actual images are inside of the albums and appear on the right of this tree. This is how Photos works. Please consult the Photos Help for further information.