-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(web): rotate image #16089
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): rotate image #16089
Conversation
832fb18 to
a3370d2
Compare
|
Wouldn't it be better to set the orientation tag in the preview and thumbnail instead of regenerating them? |
|
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. |
|
Deploying preview environment to https://pr-16089.preview.internal.immich.cloud/ |
a3370d2 to
4522959
Compare
|
@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. |
4522959 to
779bff4
Compare
779bff4 to
9cd0871
Compare
mertalev
left a comment
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.
Can you debounce the rotation clicks? It's not good if they rotate multiple times and queue multiple thumbnail jobs that run in parallel. Besides being unnecessary work, it can cause all kinds of race conditions.
server/src/services/media.service.ts
Outdated
| const processInvalidImages = process.env.IMMICH_PROCESS_INVALID_IMAGES === 'true'; | ||
|
|
||
| const orientation = useExtracted && asset.exifInfo?.orientation ? Number(asset.exifInfo.orientation) : undefined; | ||
| const orientation = asset.exifInfo?.orientation ? Number(asset.exifInfo.orientation) : undefined; |
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 is how it used to work and it was changed to handle HEIC files correctly.
web/src/lib/components/asset-viewer/actions/rotate-action.svelte
Outdated
Show resolved
Hide resolved
mertalev
left a comment
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.
HEIF needs to be handled correctly before this can be merged. It's the dominant format for most libraries; it can't be an afterthought.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@mertalev wrote:
@jrasm91 wrote:
@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? |
|
We're starting to pick this up internally again. |
|
What is the current status of this? Are there any further adjustments that need to be made? |

Image rotation
Description
This PR adds the rotation feature by saving/updating the
Orientationexif 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 onasset.checksum, which isn't updated with this type of edit.API Changes
Fixes #8355 (and potentially double rotates other HEIF images, which can at least now be fixed in the web ui directly)