-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat(web): manual face tagging and deletion #16062
base: main
Are you sure you want to change the base?
Conversation
@@ -717,4 +719,25 @@ export class PersonService extends BaseService { | |||
height: newHalfSize * 2, | |||
}; | |||
} | |||
|
|||
async tagFace(auth: AuthDto, dto: TagFaceDto): Promise<void> { | |||
await this.requireAccess({ auth, permission: Permission.PERSON_READ, ids: [dto.personId] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could argue this should require PERSON_WRITE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PERSON_WRITE or PERSON_CREATE is to create a new person in the person table. Here you need to be able to read the person list in order to create a new entry in the asset_faces table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be a new permission like Permission.FACE_CREATE
Awesome! Instead of "delete face" and a bin icon, I would suggest "unlink face" and something like https://pictogrammers.com/library/mdi/icon/link-off/. I think the list of names in the editor is broken on dark mode. |
@ApiProperty({ type: 'integer' }) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
imageWidth!: number; | ||
|
||
@ApiProperty({ type: 'integer' }) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
imageHeight!: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be preferable to move this server-side and infer it from the file. Either by getting metadata from sharp or by just storing the preview dimensions in the database in the asset_files table.
server/src/dtos/person.dto.ts
Outdated
export class DeleteFaceDto { | ||
@ValidateUUID() | ||
assetFaceId!: string; | ||
|
||
@ValidateUUID() | ||
personId!: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't include personId
and the access check can infer the person from the assetFaceId
@@ -717,4 +719,25 @@ export class PersonService extends BaseService { | |||
height: newHalfSize * 2, | |||
}; | |||
} | |||
|
|||
async tagFace(auth: AuthDto, dto: TagFaceDto): Promise<void> { | |||
await this.requireAccess({ auth, permission: Permission.PERSON_READ, ids: [dto.personId] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be a new permission like Permission.FACE_CREATE
Deploying preview environment to https://pr-16062.preview.internal.immich.cloud/ |
This PR adds the ability to tag a face area and delete identified faces from the asset
Tagging interface
Removal option