-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots of metadata errors when trying to export with --exiftool --keyword-template "{label}"
#1344
Comments
These are probably actual errors where the photo in the database has the wrong UTI (uniform type identifier) associated with it. I've seen this happen before, particularly when external apps are used to edit photos. If the photo type is wrong, exiftool will not corrupt the image but also likely won't export the metadata to the image. But just to make sure there's not a bug in osxphotos, please run the following commands and send me the output to osxphotos.py@gmail.com
|
For some further output, here's the result of that command listed in my Reproduce section with a fresh library:
So looks like 114 files had errors of some variety. Not sure why 8000 reported as missing, maybe some downloads failed. |
@gabeklavans for one of your errors "atom is too large for rewriting See: exiftool option largeFileSupport As @RhetTbull points out the UTI info may be incorrect. But please note not all image types support EXIF and XMP data in the same way. PNG for instance does not. I normally convert then into JPG with I also do it for TIF files. Not the smartest code I've written ;) but I do that with the following bash functions: # Command which convert .PNG files into .JPG and copies EXIF fields ...
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
# Command which convert .TIF files into .JPG and copies EXIF fields ... Uses ModifyDate as the source for DateTimeOriginal, File ModifyDate, CreateDate fields
exiftif2jpg ()
{
for a in "$@";
do
fname=`basename "$a" .tif`;
dname=`dirname "$a" `;
if [ -f "${dname}/${fname}".tif -a ! -f "${dname}/${fname}".jpg ]; then
echo ok - ${fname};
sips -s format jpeg -s formatOptions 100 """${dname}/${fname}".tif"" --out """${dname}/${fname}".jpg"";
exiftool -overwrite_original_in_place -TagsFromFile "${dname}/${fname}".tif "-all:all>all:all" "${dname}/${fname}".jpg;
echo Performing... ""-DateTimeOriginal\<FileModifyDate"" ""-CreateDate\<FileModifyDate"" on "${dname}/${fname}".jpg;
exiftool -overwrite_original_in_place """-DateTimeOriginal<ModifyDate""" """-CreateDate<ModifyDate""" """-FileModifyDate<ModifyDate""" -P -v "${dname}/${fname}".jpg;
fi;
done
}
export -f exiftif2jpg
|
Thanks for the tip on this. However, it doesn't seem to work, in my case. When I add the following to my command:
I will probably still keep exif on as it works for most of my exports. I just saw a bunch of errors and worried that it was messing up my export. It may be messing with the ability to download missing files, as when I ran without the exiftool option it seemed to successfully download way more photos, but maybe now that they're actually downloaded I can continue to use the exiftool option with minimal worry. Man, I really wish Apple would just provide a proper export tool... |
Another option is to export sidecars using |
Yeah, I considered that. A pretty neat option, but I was striving for maximum convenience, at maybe the cost of some lost metadata. As long as I can see all the photos, I think I'm happy. Anyway, it sounds like all my questions have been answered, or have been given paths forward, and that it's not a problem with the application. Thanks for the help! |
From the data you sent, the PNG file is really a JPEG. It looks like it may have been adjusted by Google Photos. I've seen this in the past with images touched by an external app having the wrong UTI.
For the HEIC image, Photos thinks this is a HEIC:
And I can see no indication an external app touched this image so that's a mystery. I have seen other cases where the UTI is wrong in Photos (always associated with an external app). There's an issue (#382) to add an option to fix these upon export. One of these days I'll get around to implementing that; it's not a trivial change to the export code because I'll need to maintain the mapping between "reported" and "actual" extension for every photo exported and will need to figure out a way to verify the actual UTI (ideally without calling exiftool). |
Describe the bug
The app reports lots of errors on my photo library when trying to export all metadata using exiftool. Most of them are complaints about the file having the wrong filetype, but there are others too (see "screenshots").
To Reproduce
mkdir osxphotos-gabe
osxphotos export --cleanup --update --download-missing --use-photokit --preview-if-missing --exiftool --keyword-template "{label}" --add-missing-to-album 'osxphotos missing' --report 'export_{today.date}.csv' osxphotos-gabe
Expected behavior
All photos are downloaded from the cloud with their proper metadata
Screenshots
Here's a selection of the kinds of errors I get:
and potentially others.
Desktop (please complete the following information):
Additional context
Running the script mentioned here does in fact report lots of files with the "wrong" extension; way too many for me to hope to deal with by hand. Likely over 100. I'd have to script something up to deal with it. I was hoping that fully re-downloading my library from iCloud would fix all these, but it does not. I guess Apple just has a bunch of these with the wrong extension, potentially from when I imported photos from other services.
I'm not sure if it's worth fixing all these, since a normal export seems to function fine. I may just be missing my juicy complete metadata...
Anyway, I thought I'd report this in case anyone has some advice or if this is a sign of some backend change breaking things. It could very well be my fault, somehow, though.
The text was updated successfully, but these errors were encountered: