immich icon indicating copy to clipboard operation
immich copied to clipboard

feat(web): rotate image

Open jrasm91 opened this issue 9 months ago • 4 comments

Image rotation

Description

This PR adds the rotation feature by saving/updating the Orientation exif tag to a sidecar file. Afterwards, it queues jobs to regenerate thumbnails, which now use the saved orientation value. The only thing left to do is change the url so it can bypass the frontend cache which currently relies on asset.checksum, which isn't updated with this type of edit.

API Changes

PUT /api/assets { assetIds: [], orientation: <1,2,3,4,5,6,7,8> }
PUT /api/assets/:id { orientation: <1,2,3,4,5,6,7,8> }

Fixes #8355 (and potentially double rotates other HEIF images, which can at least now be fixed in the web ui directly)

image image

jrasm91 avatar Feb 13 '25 22:02 jrasm91

Wouldn't it be better to set the orientation tag in the preview and thumbnail instead of regenerating them?

mertalev avatar Feb 13 '25 23:02 mertalev

I can see if it is possible to update them by simply changing exif. I was under the impression that it wouldn't change how it displayed it.

jrasm91 avatar Feb 14 '25 05:02 jrasm91

Deploying preview environment to https://pr-16089.preview.internal.immich.cloud/

github-actions[bot] avatar Feb 14 '25 10:02 github-actions[bot]

@mertalev you combined all the jobs together, but thumbhash still needs to be regenerated when orientation changes. I can't be bothered to rewrite this just to prevent regenerating 2 thumbnails. image

jrasm91 avatar Feb 14 '25 15:02 jrasm91

When’s the expected release date for this feature?

marekStef avatar Apr 13 '25 18:04 marekStef

@mertalev wrote:

  • HEIF needs to be handled correctly before this can be merged

  • Can you debounce the rotation clicks?

@jrasm91 wrote:

I can't be bothered to rewrite this just to prevent regenerating 2 thumbnails.

@jrasm91 : Where are you on this? Have you given up on this PR? (Which would be fair enough. This is open source and voluntary after all...)

It seems like very worthy functionality, but it sounds like it needs the finishing touches. Would anybody be able to provide any hints on how to complete this?

pmorch avatar Jul 12 '25 16:07 pmorch

We're starting to pick this up internally again.

danieldietzler avatar Jul 12 '25 19:07 danieldietzler