-
-
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): rotate image #16089
base: main
Are you sure you want to change the base?
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
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.
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
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.
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 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)