-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
RAW files (RAF, CR2, DNG) have wrong face preview due to wrong dimensions #13049
Comments
If I understand you correctly, each person's face photo (as shown on the "/people" URL, i.e. the "People" page) is showing a wrong part of the correct image (e.g. a plant behind the person instead of the actual head)? |
Correct, yes! That’s a much better way of putting it. |
Thank you for the clarification! Do you know if there's anything special about the people/faces/photos? Did you modify them? Can you reproduce this (with new people/photos)? |
I didn't realize this until now, but it seems like it might only be happening with Fuji Raw (.RAF) files! The same behavior occurs if I select a .RAF photo as the preview manually. I just checked with Sony's Raw files (ARW) and they select the face correctly. |
That's great (for debugging) :) Could you please provide a sample .RAF picture with a face on it? |
I will get back to you on that. For the life of me, I can't find one that uploads and causes the same issue. I appreciate your help! |
It's possible that this issue was fixed in the meantime... |
I just updated from 116 to 117 earlier today, that might be it. All the scans had been done on 116. I’m re-running the face detection+recognition jobs now, I will report back once they’re done. |
I just rebuilt all thumbnails in my library (~40k images), the majority of which are CR2 raw files. I'm seeing the exact same issue. The box around the face is correct, but the part of the photo used for the person's picture is wrong. I picked one person, opened an image with a (to me) good face, confirmed that the box was actually around his face, then went back to the person and set that as his featured photo. His featured photo is now a section of wall, not his face. I'm happy to share the file, if you need more data. I'd rather not redo all of the face detection and grouping, because that was a lot of work, but if y'all think it'd be worthwhile, I'll kick it off tonight (US/Central) and it should be done by morning and will report back. Edit: I just kicked off a full face detection/recognition job. Will report back when it's done. I'm also running 1.117.0. |
@stjeanp yes, please share the file and let us know of any pattern you might suspect (only CR2 raw files, for example?) |
@C-Otto The redo of the face detection/grouping completed and I've found a good example, since this person only appears in five files, all of which are CR2 files. I can't attach the zip of them because it's too big, but if you message me, I can give you a URL to download it. Sorry. Here's some explanatory screenshots though. Please let me know what else you'd like me to do. And here's one where her feature photo is now a piece of the wall instead of her face, after selecting the topmost image to use as her feature photo: |
Thanks, that looks helpful. I just sent a mail regarding the link to the raw file(s). |
Got it, replied with the link. Let me know when you're good and I'll take it down. |
Got it, thanks - feel free to delete the file. |
The image dimensions are off, for the images provided by @stjeanp I see 1728x1152 (2MP), while Gimp shows 3522x2348 (8MP). Using exiftool I get:
Any idea what might be the cause of having three different sizes? This wrong image size does not only mess up the "generate face preview" bit, but also shows in the details pane on the screenshots above. |
@skylatian do you notice any weirdness related to reported and actual image dimensions? You should be able to see what Immich thinks in the detail view (which you included in your screenshots). Maybe the actual images don't match these dimensions? |
@C-Otto I do, good catch.
It seems immich is listing the resolution as scaled down by a factor of ~0.707 for mine compared to ~0.49 for @stjeanp’s. Sony RAWs do not have this problem. I have no idea why exiftool would report three sizes, maybe it’s something related to the baked-jpeg preview? |
There is an "Exif Image Width/Height" field in the CR2 sample above that's accurate. Can you check with exiftool if the RAF file also has this? We could prefer this field when it exists during metadata extraction. |
Are you able to see/extract the JPG preview image that's part of the raw image? If so, is this preview smaller than the actual image? In https://exiftool.org/forum/index.php?topic=4709.0 this is mentioned as a possible cause. With |
I'm not sure where those |
Interestingly enough, the CR2 format allows for embedded, smaller JPEG versions of the image. I'm looking for a tool to do a deep dive into that CR2 file to see if it has any of that in it. Sort of a structure dump. |
from
I have no idea where that Output of |
Of course this one doesn't use |
If that looks like it'd work, that's great! If you need to add a one of my images to the test suite, I've got some better ones that I'd be happy to contribute. Please let me know if there's anything I can do to help. |
It'd be great if you could make a PR to add one in the test-assets repo! |
If we go along the route of considering multiple tags, we could just take the maximum we find. |
You’d think, but apparently not! As far as I know, the “cropped” resolution here is the correct one. This is from a Fuji x100v |
@mertalev - I'm looking at the repo now and will open a PR later today. I've upgraded bodies a few times and have CR2s from an EOS 30D, EOS 70D, and a PowerShot G12. The raws from the 30D and G12 are showing the smaller image size issue. I can't find a 70D RAW that's exhibiting this issue though. Would you like me to include all three files in the PR? |
Ideally you'd open separate PRs (and include the exiftool output in each). That'd be my preference, if that counts :) |
Will do! Working on that now. |
@C-Otto - Quick question: do you want people in them or just landscapes/buildings/etc. I've got both, and have people ones that are me and my spouse, both of which give permission to use the files. |
I think the actual contents don't matter, we only care about the metadata. If you provide pictures of your wall or just plain black images, that still helps (and it might keep the filesize down). |
Sounds good. There are three PRs waiting for review. Glad to have been able to help out, and please let me know if there's anything else I can do to help move this fix forward. |
immich-app/test-assets#11 can be used to reproduce this, I think. Image Width/Height are 1600x1200, but 3648x2736 seems to be closer to the truth. |
@skylatian can you provide a RAF file where neither "ImageWidth" nor "ExifImageWidth" show the correct width? |
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049
How many faces/people are affected? Even with the fix, you'd need to somehow fix the preview images (manually is one way, but there are others). |
For me, I've got 900+ detected faces over ~40k images. I don't mind doing a rebuild once the fix is in. That might be onerous for some users though. |
Happy to, I'll open a PR later today. Unfortunately, I looked at a raw (.DNG) from a family member's Ricoh GR3, and neither
Image Size and Image Width are the same, but the correct resolution is Default Crop Size as confirmed by Lightroom and Finder. If I'm not mistaken, #13377 wouldn't address this. Thoughts? |
This is truly incredible. At least using |
It's not going to bother the three Canon bodies I've got RAWs from, none of them use that tag.
|
Isn't it? Update on the Ricoh, though. I hadn't run exiftool with the
So... there are THREE |
Please provide interesting example images so that I can tune the PR and retain that knowledge in automated tests. It doesn't make a lot of sense to break metadata extraction for other cameras, nor does it feel right to ignore information already noted in this issue. It's a mess, but if we're able to hide that mess in somewhat clean code, I'd say that's an improvement. |
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049 Add Fujifilm X100v RAW File (#12) Added Fujifilm X100v RAF RAW File
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049 Add Fujifilm X100v RAW File (#12) Added Fujifilm X100v RAF RAW File
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049 Add Fujifilm X100v RAW File (#12) Added Fujifilm X100v RAF RAW File
@skylatian could you provide a problematic DNG file, please? |
For some RAW formats/cameras, the ImageWidth/ImageHeight information represents the dimensions of the preview image, i.e. much smaller than the actual image. This also causes issues with (face/people) thumbnail generation. The information in ImageSize seems to be correct, so we use this instead. fixes #13049 Add Fujifilm X100v RAW File (#12) Added Fujifilm X100v RAF RAW File
The bug
This bug differs from #12440 in that the preview box correctly surrounds the person's face, but the preview image that shows in the People tab (or in file details) is not zoomed/cropped to the correct location in a photo.
This issue is fixed when manually selecting "Select Featured Photo." This cases the profile picture/preview for that particular person to be cropped correctly.
(note - the image shown vs. source for "featured thumbnail" are slightly different photos (taken a few seconds apart), but the effect happens with that photo as well and I didn't want to re-blur for anonymity)
The overall "People" tab. Every one of these is a validly recognized person, the thumbnail ("Featured Photo") is just misaligned.
The OS that Immich Server is running on
Windows 10 Server
Version of Immich Server
v1.116.2
Version of Immich Mobile App
n/a
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
The issue:
The manual fix:
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: