-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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) 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 |
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
I've had no luck tracking down a DNG from one of those cameras. @skylatian - have you been able to upload one? |
Apologies, I missed the previous comment! I have not, the only file I have is 31.2mb, which is larger than github's 25mb limit. If that would still work the for devs I would be happy to upload it to google drive or something though, just let me know. I won't be able to get a (potentially) smaller file sent to me for another week or so. |
@skylatian absolutely, that would help! Thank you |
Of course! There are GPS coordinates included but it's not a privacy concern, I will have to delete it from my drive at some point though so let me know when I can take it down. Thanks for looking into this! https://drive.google.com/file/d/1XSicJPWW-3HDeBaV9wcty0SZJJrb53p4/ |
I got it, thanks |
@skylatian that DNG file doesn't expose any issue in the current version of Immich. Could you please check? |
@skylatian - sorry to be a pest, but have you had any luck finding a DNG that displays the issue or is it a red herring? |
@stjeanp shoot, apologies, I've been absolutely swamped recently. I appreciate the extra ping! it seems like it's a red herring, it seems to perform properly with immich. |
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
Alright, #13377 is ready for review then |
Added Fujifilm X100v RAF RAW File fix(server): prefer ImageSize over ImageWidth/Height metadata 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
Added Fujifilm X100v RAF RAW File fix(server): prefer ImageSize over ImageWidth/Height metadata 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
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: