Replies: 5 comments 17 replies
-
Happy to help but need a bit more data.
Are you using iCloud Photos? If so, in If you are not using iCloud or "Download originals to this Mac" is checked, then something else is wrong and I'll provide some more debug steps.
So I'm guessing it's not an iCloud library. If so, how did you create it?
This must have something to do with how the test library was created. Need more info on that.
The
These errors are from exiftool and it appears you've got some images that have one extension but are actually something else. I've seen this before but usually related to editing images in a 3rd party app that didn't follow the guidelines for editing photos. It could also be related to importing photos from Google photos if something got mixed up in the process. When you see these errors there should be an error message that includes the UUID (universally unique identifier) for the photo. Given the UUID, you can do the following:
You cannot run exiftool this way. osxphotos only uses exiftool to output the metadata to the exported photo not to do any other transforms and not against the original image in the library. If it's an iCloud library doing so risks data corruption. It would be possible to run exiftool against the library using a custom script that uses osxphotos but I'd need to understand a lot more about the issue before even attempting something like this.
That's probably what's happening. It may be that osxphotos is creating the folder before it knows if the file is actually not missing and thus leaving an empty folder. If so, this might be classified as a bug. I'll open a separate issue for this so I remember to look into it. If you include the
Your export command won't do this. In particular, the machine learning labels ("dog", "tree", "beach", etc.) that Photos adds to help with searching won't be exported. OSXPhotos calls these |
Beta Was this translation helpful? Give feedback.
-
Thank you so so much for your help. My comments below inline with yours!
On Tue, Feb 20, 2024 at 11:29 PM Rhet Turnbull ***@***.***> wrote:
Happy to help but need a bit more data.
I cannot for the life of me figure out why the library is "missing" 99% of
its images.
Are you using iCloud Photos? If so, in Photos > Settings > iCloud >
iCloud Photos is "Optimize Mac Storage" checked? If so, then the photos
are missing because they're in iCloud but not downloaded to the Mac. They
appear in Photos because Photos keeps a preview image then downloads them
on demand.
I started with an icloud library. I always keep my library on "download
originals" not "optimize space". That original library was 1-0. I made
changes to that library using powerphotos to merge other smaller libraries
like the "test" library into the main library. As I did so I changed the
file number to 1-1, 1-2, 1-3, and now 1-4. None of those versions have
been connected to the internet. Based on your concern I have made 1-4 the
system library and selected "download all photos". As you know I can't
control the sync process but in the next 24 hours I should be able to
confirm that there are no files stranded in the cloud.
If you are not using iCloud or "Download originals to this Mac" is
checked, then something else is wrong and I'll provide some more debug
steps.
The 15GB library was a test library to save time while I practiced.
So I'm guessing it's not an iCloud library. If so, how did you create it?
The test library is an example of a library I created by gathering files
from other sources with a goal of unifying all the files in Apple Photos
and then ultimately in Lightroom Classic. These files came from Google
Photos. Others have been scanned in from paper photos, etc.
All of the 297 exported files in my small library end with "_edited".
This must have something to do with how the test library was created. Need
more info on that.
The test library is a subset of my photos. I'm guessing that out of the
45552 photos, 297 photos had been lightly edited in some way. Other than
that I am not sure what I did while creating that library which was out of
the ordinary. As I mentioned above I HAVE been slamming libraries together
and pulling them apart and transferring them back and forth from NAS drives
so it is conceivable that in the process I broke something inside the
Photos database(?).
The file number I added to the end (using --filename "{created.date}-{counter:05d(1)}")
seems to include the missing files, so they look like
"2013-01-08-45264_edited.jpeg"
The {counter} template increments each time it's evaluated and it's
evaluated for every asset being checked for export. The rendered filename
is produced *before* osxphotos knows if the file is present in the
library to be exported or not so that's why you're seeing this. All the
"missing" photos incremented the counter. The counter is probably not
really what you want -- it's a dumb counter that simply increments and
isn't unique to the photo. What are you trying to accomplish? Why are you
appending the counter? You might prefer to use {id} which *is* a unique
number for each photo. If you don't include a {counter} or {id} you'll
automatically get 2023-01-08 (1).jpeg, 2023-01-08 (2).jpeg and so on.
Thanks for your guidance on this. I am trying to have a folder hierarchy
YEAR > MONTH and fiile name YYYY-MM-DD-TOPIC-#### where each topic (i.e.
xmas) starts over from 0001 (I think? Tell me if you disagree with that
plan!). Topics were going to be pulled from Album Names.
1. HOWEVER, I get a zillion errors in the form of: Error: Not a valid
PNG (looks more like a JPEG) or Error: Not a valid HEIC (looks more like a
JPEG)
These errors are from exiftool and it appears you've got some images that
have one extension but are actually something else. I've seen this before
but usually related to editing images in a 3rd party app that didn't follow
the guidelines for editing photos. It could also be related to importing
photos from Google photos if something got mixed up in the process. When
you see these errors there should be an error message that includes the
UUID (universally unique identifier) for the photo. Given the UUID, you can
do the following:
osxphotos debug-dump --dump photos --uuid UUID > debug.txt (substitute
the UUID for UUID) Post the file here or send to me at
***@***.*** and I'll take a look to see what Photos says the
file really is.
Do you want me to get all the UUIDs for all the error photos or just a
single representative photo? It seems like they are all either "Not PNG"
or "Not HEIC" so I could get one of each?
The problem is that I dont understand how to run exiftool inside osxphotos
to achieve the outcome this post was suggesting. I tried to run it like
this:
You cannot run exiftool this way. osxphotos only uses exiftool to output
the metadata to the exported photo not to do any other transforms and not
against the original image in the library. If it's an iCloud library doing
so risks data corruption. It would be possible to run exiftool against the
library using a custom script that uses osxphotos but I'd need to
understand a lot more about the issue before even attempting something like
this.
1. I get a lot of folders which are empty. I guess it is creating the
year folder and month folder and then going to find the photo itself and
determining that it is "missing"?
That's probably what's happening. It may be that osxphotos is creating the
folder before it knows if the file is actually not missing and thus leaving
an empty folder. If so, this might be classified as a bug. I'll open a
separate issue for this so I remember to look into it. If you include the
--cleanup option to your export command, it will cleanup (delete) any
files and folders that osxphotos didn't export and that should clean up
these ghost directories. But definitely something I'll look into.
Great, thanks for explaining that. Will do.
My goal is to export my 200k photos/videos while saving every last little
bit of ML brilliance Apple has imparted to my photos
Your export command won't do this. In particular, the machine learning
labels ("dog", "tree", "beach", etc.) that Photos adds to help with
searching won't be exported. OSXPhotos calls these labels and you can
include these if you like by adding --keyword-template "{label}" to your
export command.
Ok, I'm glad you brought that up since my MAIN reason for using OSXPhotos
is to grab all these goodies like apple's hidden keywords, aesthetic score,
face info, finder tags, etc. because it doesn't seem like any of the LRC
plug-ins or stand-alone apps seem to do that great a job at ML keywording.
I started with a more complicated export command which included
--keyword-template
"{label}". For instance my export command was:
osxphotos export --export-by-date --db=/Users/matthewgreer/Pictures\ Family
Photo Database.photoslibrary --filename=%Y-%m-%d-%04d --skip-live
--exiftool-option -m --favorite-rating --ignore-date-modified
--person-keyword --keyword-template "{folder_album(>)}"
--keyword-template "{label}" --finder-tag-keywords
--xattr-template findercomment "{title,}{title?{descr?{newline},},}{descr,}"
--dry-run --verbose --report export1.csv --overwrite
Users/matthewgreer/Pictures/EXPORT1 --retry 3
But I get this response: Error: No such option: --keyword-template {label}
Did you mean --keyword-template?
*Can I send you money on buy me a coffee or patron or something? *
THANKS!
Matt
—
… Reply to this email directly, view it on GitHub
<#1409 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR6K5LIUAOLWB4IPSFJEQZDYUVZZ3AVCNFSM6AAAAABDSF5S62VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMZYGM4DK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm guessing something happened in this process that caused the library to not be the system library (so it wasn't downloaded from iCloud) but all the images had not yet been downloaded from iCloud before this happened. With as many changes to libraries as it sounds you've been making it is hard to know what state the library is actually in.
This isn't possible currently given your use case. There is an If this was implemented you could do something like this:
which would use
Just pick one of each PNG/HEIC and send the data.
You can easily get labels (hidden keywords) using You've already figured out Finder tags with The faces will be written to the XMP data using The aesthetic score though is bit tougher. That's not exported by default and I'm not sure where you'd stick it as there's no standard for this kind of metadata. One option might be to append it to the description:
This sets the description (caption) of the photo to the existing description if there is one, followed by a newline then adds "Score:0.75", etc.
Odd. I can't reproduce this. It sounds like you're missing a space between
I appreciate the sentiment but for various reasons I don't accept donations for osxphotos. Thanks though! |
Beta Was this translation helpful? Give feedback.
-
@msg43 I took a look at implementing the ability to use
This will render filenames as
Alternatively, osxphotos will download the template function for you so you could call it like this:
You can examine the source code of the function and change the template format to something else if desired. |
Beta Was this translation helpful? Give feedback.
-
@msg43 osxphotos version 0.67.5 now includes a new
will give you a CSV file listing every asset in both libraries and indicating if they're in the other, if they are the same as the other library, or if they're different (e.g. different metadata) and if so, what the differences are. It is a resource hog as both libraries get loaded into memory so comparing two big libraries will be slow but this may help determine what's different in your multiple libraries. |
Beta Was this translation helpful? Give feedback.
-
I POSTED THIS TO R/OSXPHOTOS subreddit as well
Hi all!
My goal is to export my 200k photos/videos while saving every last little bit of ML brilliance Apple has imparted to my photos so I can more easily cull them and start putting them into scrap books for the grand parents...
I didn't want to ask super-dumb questions so I tried my best by studying the help files, reading the online discussions, googling errors, and asking ChatGPT for help. I started at zero knowledge and ended up here so far:
osxphotos export /Users/USER/Pictures/EXPORTFOLDER --filename "{created.date}-{counter:05d(1)}" --directory "{created.year}/{created.mm}" --exiftool --person-keyword --album-keyword --favorite-rating --ignore-date-modified --finder-tag-keywords --report export2.csv --overwrite --skip-live
I am stuck on a few things:
Processed: 45552 photos, exported: 297, missing: 45549, error: 0
I cannot for the life of me figure out why the library is "missing" 99% of its images. I have checked the Apple Photos library and the files sure seem to be there (full sized files, not just low-res previews). I have tried with three different apple photos libraries. Same issues. This photo library is 15GB.
I have also tried just running "% osxphotos export /Users/USER/Pictures/FOLDER" and I get the same result.
All of the 297 exported files in my small library end with "_edited".
The file number I added to the end (using --filename "{created.date}-{counter:05d(1)}") seems to include the missing files, so they look like "2013-01-08-45264_edited.jpeg" which is interesting because it seems like the counter increments even though the file is "missing". Not a problem per se, but annoying since it yields folders with essentially random file numbers.
Perhaps similar to Feature: --version to command line utility #4, I get a lot of folders which are empty. I guess it is creating the year folder and month folder and then going to find the photo itself and determining that it is "missing"?
The 15GB library was a test library to save time while I practiced. When that didn't work I decided to just try the command on my main library which is 700GB. With the same command I DID get lots of files, and those files were full size, and they were JPG, HEIC, and PNG, and those files did not say "_edited". HOWEVER, I get a zillion errors in the form of:
Error: Not a valid PNG (looks more like a JPEG)
or
Error: Not a valid HEIC (looks more like a JPEG)
I had to terminate the experiment because it would have run for hours spitting out these errors.
I found one person who had the same errors I had (I also used Google Takeout at one point). The gurus suggested that OP fix the problem by running exiftool. The post is at the following link.
Link: https://exiftool.org/forum/index.php?topic=12602.0
The problem is that I dont understand how to run exiftool inside osxphotos to achieve the outcome this post was suggesting. I tried to run it like this:
osxphotos export /Users/matthewgreer/Pictures/EXPORT9 --filename "{created.date}-{counter:05d(1)}" --directory "{created.year}/{created.mm}" --exiftool -ext heic '-Filename<$BaseName.FileTypeExtension' --person-keyword --album-keyword --favorite-rating --ignore-date-modified --finder-tag-keywords --report export2.csv --overwrite --skip-live
And I get the following error:
Error: No such option: -e
NB: https://www.reddit.com/r/osxphotos/comments/18uqm22/comment/kfmamp3/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
THANK YOU SO MUCH TO EVERYONE FOR YOUR HELP AND PATIENCE!!
Beta Was this translation helpful? Give feedback.
All reactions