osxphotos
osxphotos copied to clipboard
finder tags and findercomment not working & skipping
Using the following command to achieve my export from photos library to external SSD (was trying to do it on my NAS but kept failing due to many files open) and created a temp folder as suggested to improve performance. However it seems that for most if not all the files it is skipping the finder tags and finder comments (please see below):
Used Command:
osxphotos export /Volumes/OSXPHOTOs/Export --touch-file --finder-tag-keywords --person-keyword --xattr-template findercomment "{title}{title?{descr?{newline},},}{descr}" --exiftool-merge-keywords --exiftool-merge-persons --keyword-template "{label,}{folder_album(>)}" --exiftool --directory "{created.year}/{created.mm}-{created.month}/{folder_album,}" --filename "{created.date}-{title,}{original_name}{favorite? ♥️,}" --jpeg-ext "jpg" --update --skip-edited --strip --verbose --tmpdir /Users/aidin/Desktop/OSXPTemp
Sample of verbose: Exporting MVI_3724.MOV (CAFBEA90-59A6-405C-B11A-4DEF56A7598E.mov) (2055/50195) Writing metadata with exiftool for 2022-01-09-MVI_3724.MOV Exported MVI_3724.MOV to /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV Exported new file /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV Touched date on file /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV Skipping Finder tags for /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV: nothing to do Skipping Finder tags for /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV: nothing to do Skipping extended attribute findercomment for /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV: nothing to do Skipping extended attribute findercomment for /Volumes/OSXPHOTOs/Export/2022/01-January/2022-01-09-MVI_3724.MOV: nothing to do
also many PNG files give the exiftool(I have it installed) warning: exiftool warning for file /Volumes/OSXPHOTOs/Export/2020/10-October/2020-10-19-IMG_5266.PNG: Warning: Creating non-standard IPTC in PNG - /Users/user/Desktop/OSXPTemp/osxphotos_export_w3fpcz5l/FB0FF019-1E2D-4DA4-97FA-9074BE5D9D80_exiftool.png
Thank you in advance for your help and time. Hopefully we can get this fixed so I can organize 20+ years of my life finally! xD
@elonbot hi there.
PNG files
As an osxphotos fellow user please note PNG format files can't hold all the available metadata, hence the error.
I normally either:
- convert PNG to JPG and adjust the metadata with exiftool either prior to upload into Photos
- or I do a cycle of export PNG/convert to JPG/re-upload into Photos the JPG to the same album/delete old PNG from Photos (if you want I can then later share the discussion where Rhet explained me on how to do it.
finder errors
For the finder errors, I can't help much as I don't use it but it states "nothing to do" so either the MOV files don't have keywords, title, description or there is something fishy. Rhet will surely figure it out.
NAS copy
I have ran exports to Synology 415+ and 918+ for the past two years quite successfully.
I use SMB v3 protocol to map the shared folders from the NAS into the MAC.
Do check #703. I use retry, ram and a local exportdb file.
For converting PNG to JPG files on a MAC I use the sips
command that I warp around the following function.
exifpng2jpg ()
{
for a in "$@";
do
fname=`basename "$a" .png`;
xtension=png;
echo 1st - ${fname}.${xtension};
if [ \( -f "${fname}".png -o -f "${fname}".PNG \) -a ! -f "${fname}".jpg ]; then
echo ok - ${fname}.${xtension};
sips -s format jpeg -s formatOptions 90 """${fname}".${xtension}"" --out """${fname}".jpg"";
exiftool -overwrite_original_in_place -TagsFromFile "${fname}".${xtension} "-all:all>all:all" "${fname}".jpg;
else
fname=`basename "$a" .PNG`;
xtension=PNG;
echo 2nd - ${fname}.${xtension};
if [ \( -f "${fname}".png -o -f "${fname}".PNG \) -a ! -f "${fname}".jpg ]; then
echo ok - ${fname}.${xtension};
sips -s format jpeg -s formatOptions 90 """${fname}".${xtension}"" --out """${fname}".jpg"";
exiftool -overwrite_original_in_place -TagsFromFile "${fname}".${xtension} "-all:all>all:all" "${fname}".jpg;
fi;
fi;
done
}
export -f exifpng2jpg
And then I execute:
exifpng2jpg *.png
Thanks @oPromessa !
@elonbot @oPromessa is right about the PNG files and supported EXIF. I suppose one option would be to allow separate exiftool tags for different file formats but this is complicated. Another might be to filter out any EXIF commands that PNG doesn't support. Will need to think about this.
For the finder tags, it appears there's no update needed. Check the file MVI_3724.MOV
in Photos. Does it have a title and/or a description? If so there may be a bug. If not, it's just that osxphotos sees the finder tag has no value and thus doesn't set it.
Thank you, Understood. I did some digging after and learned about the png process but I really appreciate you sending me the code to convert as well! huge help! thank you both!
As far as NAS goes, I'm on SMB3 also on an 1817+ (it is 60K+ images and photos so I wonder if there is a cap limit or can i run in batches maybe? ) but it kept giving me problem so i avoided for now and did it on SSD and seemed to work. I'll check out your link and hopefully try to get to the bottom of that.
I think you are right on the finder tags as it might be just that they dont have any attributes I guess. I was assuming & trying to add the labels auto generated from photos to the comments but i guess its not something possible and I must make the labels and comments myself first. Correct me if i'm wrong please :)
Again thank you both for the quick responses! Much appreciated and what an amazing tool!
NAS export
On the NAS, yes the first export is heavy.
You can use the --limit 10000
to incrementally export 10000 pics at a time.
Once you have all 60k exported you can remove the --limit.
For me on a 1GB local LAN it takes about 3 hours to update and delete around 90000 pics.
photos classifications keywords
I use a .toml to specify the osxphotos options.
To get the Photos' classifications into the keywords field of files (mov and jpg) I use the osxphotos tag "label" plus a phew others I like, as venue_type. Etc. but you can select what you want. Do make a few tests and use --dry-run to see what will happpen before going all the way.
Please note if you change keywords_template osxphotos will detect differences and re-export many if not all the pics.
[export]
cleanup = true
db = "/Users/Shared/Pictures/iPhoto Shared Library.photoslibrary"
description_template = "Album:{album,}{newline}Description:{descr,}"
directory = "{album[/,.|:,.]}"
#dry_run = true
exiftool = true
exiftool_merge_keywords = true
exiftool_merge_persons = true
keyword_template = [ "{keyword}", "{label}", "{searchinfo.activity?activity:{searchinfo.activity},}", "{searchinfo.venue_type?venue_type:{searchinfo.venue_type},}", ]
not_hidden = true
ramdb = true
report = "/Users/Shared/Pictures/Logs/colibri.csv"
retry = 2
skip_bursts = true
skip_live = true
skip_original_if_edited = true
strip = true
timestamp = true
touch_file = true
update = true
verbose = true